Added feature #14247: Add a concatenator for CSS and JS (thanks to Steffen Gebert)
[Packages/TYPO3.CMS.git] / typo3 / init.php
index 1b7d425..fd27da3 100644 (file)
@@ -88,6 +88,16 @@ define('TYPO3_mainDir', 'typo3/');           // This is the directory of the backend admi
 
 
 // *******************************
+// Fix BACK_PATH, if the TYPO3_mainDir is set to something else than 
+// typo3/, this is a workaround because the conf.php of the old modules
+// still have "typo3/" hardcoded. Can be removed once we don't have to worry about
+// legacy modules (with conf.php and $BACK_PATH) anymore. See RFC / Bug #13262 for more details.
+// *******************************
+if (isset($BACK_PATH) && strlen($BACK_PATH) > 0 && TYPO3_mainDir != 'typo3/' && substr($BACK_PATH, -7) == '/typo3/') {
+       $BACK_PATH = substr($BACK_PATH, 0, -6) . TYPO3_mainDir;
+}
+
+// *******************************
 // Checking path
 // *******************************
 $temp_path = str_replace('\\','/',dirname(PATH_thisScript).'/');
@@ -167,6 +177,10 @@ die();
        }
 }
 
+// *********************
+// Unset variable(s) in global scope (fixes #13959)
+// *********************
+unset($error);
 
 // *************************************************
 // t3lib_div + extention management class included
@@ -215,7 +229,6 @@ if (TYPO3_UseCachingFramework) {
        t3lib_cache::initPageCache();
        t3lib_cache::initPageSectionCache();
        t3lib_cache::initContentHashCache();
-       unset($typo3CacheFactory, $typo3CacheManager);
 }
 // *************************
 // CLI dispatch processing
@@ -234,13 +247,13 @@ if (defined('TYPO3_cliMode') && TYPO3_cliMode && basename(PATH_thisScript)=='cli
                } else {
                        echo "The supplied 'cliKey' was not valid. Please use one of the available from this list:\n\n";
                        print_r(array_keys($TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['cliKeys']));
-                       echo "\n";
+                       echo LF;
                        exit;
                }
        } else {
                echo "Please supply a 'cliKey' as first argument. The following are available:\n\n";
                print_r($TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['cliKeys']);
-               echo "\n";
+               echo LF;
                exit;
        }
 }
@@ -418,9 +431,9 @@ if (defined('TYPO3_cliMode') && TYPO3_cliMode)      {
        if (!strcmp($_SERVER['argv'][1],'status'))      {
                echo "Status of TYPO3 CLI script:\n\n";
                echo "Username [uid]: ".$BE_USER->user['username']." [".$BE_USER->user['uid']."]\n";
-               echo "Database: ".TYPO3_db."\n";
-               echo "PATH_site: ".PATH_site."\n";
-               echo "\n";
+               echo "Database: ".TYPO3_db.LF;
+               echo "PATH_site: ".PATH_site.LF;
+               echo LF;
                exit;
        }
 }