]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load-extension.php
also prevent it in .htacces. You may want to add this to one of your files in /etc...
[mailer.git] / inc / loader / load-extension.php
index 746957a8ccc473e9f646bba855c42b3e33ec04e8..e72c9f4271064afd03c5e259e7cf5ecd01690f62 100644 (file)
  * -------------------------------------------------------------------- *
  * @TODO Rewrite this whole file                                        *
  * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-} elseif (isInstallationPhase()) {
-       // Use this code if you don't want to run this cache loader on installation phase
-       return;
+} elseif (isInstaller()) {
+       // Do not run in installation phase
+       //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Run from installation phase.');
+       return FALSE;
 }
 
 // Next cached table is the extension
@@ -60,7 +56,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache
 
                // Loop through all
                foreach ($EXT_DUMMY['ext_name'] as $k => $ext_name) {
-                       // Load CSS file
+                       // Load CSS file?
                        if ($EXT_DUMMY['ext_css'][$k] == 'Y') {
                                addExtensionCssFile($ext_name . '.css');
                        } // END - if
@@ -123,7 +119,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache
        unset($EXT_DUMMY);
 
        // No database load needed
-       $res_ext_crt = false;
+       $res_ext_crt = FALSE;
 
        // Load all extension files in test-mode (we initialize them later)
        foreach ($EXT_POOL as $ext) {
@@ -132,18 +128,19 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache
 
        // Remove array and mark cache as loaded
        unset($EXT_POOL);
-} elseif (isHtmlOutputMode()) {
+} elseif ((isHtmlOutputMode()) || (isAjaxOutputMode()) || (isRawOutputMode())) {
        // Create cache file here
        $GLOBALS['cache_instance']->init();
 
-       // Add more if sql_patches is recent enougth
+       // Add more if ext-sql_patches is recent enougth
        $add = '';
        if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
-               $add = ',`ext_has_css` AS `ext_css`';
+               // Old naming
+               $add = ', `ext_has_css` AS `ext_css`';
        } // END - if
 
        // Query for all extensions
-       $result = SQL_QUERY('SELECT
+       $result = sqlQuery('SELECT
        `id` AS `ext_id`,
        `ext_name`,
        `ext_active`,
@@ -155,17 +152,17 @@ ORDER BY
        `ext_name` ASC', __FILE__, __LINE__);
 
        // Load all entries
-       while ($content = SQL_FETCHARRAY($result)) {
+       while ($content = sqlFetchArray($result)) {
                // Load extension
                if (!loadExtension($content['ext_name'], 'test')) {
                        // Is the name valid?
                        if (!isExtensionNameValid($content['ext_name'])) {
                                // Is not valid name (empty ext-foo.php script)
-                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
+                               sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
                                        array($content['ext_name']), __FILE__, __LINE__);
                        } else {
                                // Didn't load so deactivate it
-                               doDeactivateExtension($content['ext_name'], true);
+                               doDeactivateExtension($content['ext_name'], TRUE);
                        }
 
                        // ... and skip it
@@ -173,7 +170,7 @@ ORDER BY
                } // END - if
 
                // Get menu entry
-               $content['ext_menu'] = convertBooleanToYesNo(ifModuleHasMenu($content['ext_name'], true));
+               $content['ext_menu'] = convertBooleanToYesNo(ifModuleHasMenu($content['ext_name'], TRUE));
 
                // Get language entry
                $content['ext_lang'] = convertBooleanToYesNo(isLanguageIncludeReadable($content['ext_name']));
@@ -194,7 +191,7 @@ ORDER BY
        } // END - while
 
        // Free memory
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Close the cache
        $GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');