[TASK] Remove t3lib/config_default.php
[Packages/TYPO3.CMS.git] / typo3 / cli_dispatch.phpsh
1 #! /usr/bin/env php
2 <?php
3 /***************************************************************
4 * Copyright notice
5 *
6 * (c) 2005-2012 Kasper Skaarhoj (kasperYYYY@typo3.com)
7 * All rights reserved
8 *
9 * This script is part of the TYPO3 project. The TYPO3 project is
10 * free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * The GNU General Public License can be found at
16 * http://www.gnu.org/copyleft/gpl.html.
17 * A copy is found in the textfile GPL.txt and important notices to the license
18 * from the author is found in LICENSE.txt distributed with these scripts.
19 *
20 *
21 * This script is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
28
29 /**
30 * Command Line Interface module dispatcher
31 *
32 * This script takes a "cliKey" as first argument and uses that to dispatch
33 * the call to a registered script with that key.
34 * Valid cliKeys must be registered in
35 * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys'].
36 *
37 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
38 */
39
40 define('TYPO3_MODE','BE');
41 define('TYPO3_cliMode', TRUE);
42
43 // We use require instead of require_once here so we get a fatal error if classes/Bootstrap/Backend.php is accidentally included twice
44 // (which would indicate a clear bug).
45 require('classes/Bootstrap/Cli.php');
46 Typo3_Bootstrap_Cli::getInstance()->checkEnvironmentOrDie();
47
48 require('classes/Bootstrap/Backend.php');
49 Typo3_Bootstrap_Backend::getInstance()
50 ->checkEnvironmentOrDie()
51 ->defineBaseConstants()
52 ->defineAndCheckPaths('typo3/')
53 ->requireBaseClasses()
54 ->setUpEnvironment()
55 ->loadDefaultTypo3ConfVars()
56 ->registerExtDirectComponents()
57 ->initializeGlobalVariables()
58 ->checkLocalconfExistsOrDie()
59 ->setGlobalDatabaseVariablesToEmptyString()
60 ->loadMainConfigurationFile()
61 ->defineTypo3DatabaseConstants()
62 ->initializeCachingFramework()
63 ->registerAutoloader()
64 ->addCorePearPathToIncludePath()
65 ->checkUtf8DatabaseSettingsOrDie()
66 ->transferDeprecatedCurlSettings()
67 ->setCacheHashOptions()
68 ->enforceCorrectProxyAuthScheme()
69 ->setDefaultTimezone()
70 ->initializeL10nLocales()
71 ->configureImageProcessingOptions()
72 ->convertPageNotFoundHandlingToBoolean()
73 ->registerGlobalDebugFunctions()
74 ->registerSwiftMailer()
75 ->configureExceptionHandling()
76 ->setMemoryLimit()
77 ->defineTypo3RequestTypes()
78 ->loadAdditionalConfigurationFromExtensions()
79 ->deprecationLogForOldXclassRegistration()
80 ->initializeExceptionHandling()
81 ->requireAdditionalExtensionFiles()
82 ->setFinalCachingFrameworkCacheConfiguration()
83 ->defineLoggingAndExceptionConstants()
84 ->unsetReservedGlobalVariables()
85 ->initializeGlobalTimeVariables()
86 ->initializeTypo3DbGlobal(TRUE);
87 Typo3_Bootstrap_Cli::getInstance()->initializeCliKeyOrDie();
88 Typo3_Bootstrap_Backend::getInstance()
89 ->loadExtensionTables()
90 // TODO: Check if we really need the sprite manager on the command line
91 ->initializeSpriteManager(TRUE)
92 ->initializeBackendUser()
93 ->initializeBackendUserMounts()
94 ->initializeLanguageObject();
95
96 // Make sure output is not buffered, so command-line output and interaction can take place
97 t3lib_div::flushOutputBuffers();
98
99 try {
100 include(TYPO3_cliInclude);
101 } catch (Exception $e) {
102 fwrite(STDERR, $e->getMessage() . LF);
103 exit(99);
104 }
105
106 Typo3_Bootstrap_Backend::getInstance()->shutdown();
107 ?>