]> git.mxchange.org Git - mailer.git/blobdiff - inc/load_extensions.php
Area 'modify' added to all extensions, some fixes for installing/modifying extension
[mailer.git] / inc / load_extensions.php
index babd32e6af597a9fcbea314640b2954993556d1a..dd8c722038b1ea7c5a1294a041e6114c6d9ba3c3 100644 (file)
@@ -10,6 +10,8 @@
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Alle Erweiterungen laden                         *
  * -------------------------------------------------------------------- *
+ * @TODO Rewrite this whole file to load_cache-extensions.php           *
+ * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
@@ -46,7 +48,7 @@ $GLOBALS['cache_instance'] = null;
 $GLOBALS['cache_array'] = array();
 
 // Skip loading extensions
-if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isInstalling())) {
+if ((!isInstalled()) || (isInstalling())) {
        // Init filter system here
        INIT_FILTER_SYSTEM();
 
@@ -61,7 +63,10 @@ $GLOBALS['cache_array']['active_extensions'] = array();
 $GLOBALS['cacheMode'] = "no";
 
 // Load sql_patchrs extension alone
-LOAD_EXTENSION("sql_patches");
+if (!LOAD_EXTENSION("sql_patches")) {
+       // Could not load sql_patches! ARGH!!!
+       trigger_error("Cannot load extension sql_patches.");
+} // END - if
 
 // Init inc pool array
 $INC_POOL = array();
@@ -71,7 +76,10 @@ $INC_POOL = array();
 //
 if (EXT_IS_ACTIVE("cache")) {
        // Load cache extension alone
-       LOAD_EXTENSION("cache");
+       if (!LOAD_EXTENSION("cache")) {
+               // Extension 'cache' was not loaded
+               trigger_error("Cannot load extension cache.");
+       } // END - if
 
        // Check extension cache
        switch (($GLOBALS['cache_instance']->loadCacheFile("extensions", true)) && ($GLOBALS['cache_instance']->extensionVersionMatches("sql_patches"))) {
@@ -107,7 +115,7 @@ if ($GLOBALS['cacheMode'] == "load") {
                $GLOBALS['cache_instance']->destroyCacheFile();
 
                // Retry it
-               LOAD_INC(__FILE__);
+               require(__FILE__);
                return;
        } // END -  if
 
@@ -217,7 +225,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cacheMode'] == "init") && ($
                // Does the extension file exists?
                if (FILE_READABLE($FQFN)) {
                        // By default no extension is always active, except sql_patches
-                       $EXT_ALWAYS_ACTIVE = "N";
+                       EXT_SET_ALWAYS_ACTIVE("N");
 
                        // Load extension
                        if (($content['ext_name'] != "sql_patches") && (($content['ext_name'] != "cache") || (!EXT_IS_ACTIVE("cache")))) {
@@ -225,11 +233,11 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cacheMode'] == "init") && ($
                                LOAD_EXTENSION($content['ext_name']);
                        } else {
                                // Keep sql_patches always active
-                               $EXT_ALWAYS_ACTIVE = "Y";
+                               EXT_SET_ALWAYS_ACTIVE("Y");
                        }
 
                        // Transfer EXT_ALWAYS_ACTIVE flag
-                       $content['ext_keep'] = $EXT_ALWAYS_ACTIVE;
+                       $content['ext_keep'] = EXT_GET_ALWAYS_ACTIVE();
 
                        // CSS file handling:
                        if ((!isset($content['ext_css'])) || ($content['ext_css'] == "Y")) {
@@ -253,7 +261,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cacheMode'] == "init") && ($
                                $GLOBALS['cache_instance']->addRow($content);
                        } elseif ($GLOBALS['cacheMode'] == "no") {
                                // Remember this value for later usage
-                               $GLOBALS['cache_array']['active_extensions'][$content['ext_name']] = $EXT_ALWAYS_ACTIVE;
+                               $GLOBALS['cache_array']['active_extensions'][$content['ext_name']] = EXT_GET_ALWAYS_ACTIVE();
                        }
                } elseif (!FILE_READABLE($FQFN)) {
                        // Deleted extension file so we mark it for removal from DB
@@ -280,7 +288,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cacheMode'] == "init") && ($
 }
 
 // Run the filter
-RUN_FILTER('load_includes', $INC_POOL);
+runFilterChain('load_includes', $INC_POOL);
 
 // Uninstall extensions that are no longer in our system
 if (!empty($DEL[0])) {