3 /***************************************************************
6 * (c) 2005-2013 Kasper Skaarhoj (kasperYYYY@typo3.com)
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.
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.
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.
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
30 * Command Line Interface module dispatcher
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'].
37 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
39 define('TYPO3_MODE', 'BE');
40 define('TYPO3_cliMode', TRUE);
42 require __DIR__
. '/sysext/core/Classes/Core/CliBootstrap.php';
43 \TYPO3\CMS\Core\Core\CliBootstrap
::checkEnvironmentOrDie();
45 require __DIR__
. '/sysext/core/Classes/Core/Bootstrap.php';
46 \TYPO3\CMS\Core\Core\Bootstrap
::getInstance()
48 ->loadConfigurationAndInitialize()
49 ->loadTypo3LoadedExtAndExtLocalconf(TRUE)
50 ->applyAdditionalConfigurationSettings()
51 ->initializeTypo3DbGlobal();
53 \TYPO3\CMS\Core\Core\CliBootstrap
::initializeCliKeyOrDie();
55 \TYPO3\CMS\Core\Core\Bootstrap
::getInstance()
56 ->loadExtensionTables(TRUE)
57 ->initializeBackendUser()
58 ->initializeBackendUserMounts()
59 ->initializeLanguageObject();
61 // Make sure output is not buffered, so command-line output and interaction can take place
62 \TYPO3\CMS\Core\Utility\GeneralUtility
::flushOutputBuffers();
65 include(TYPO3_cliInclude
);
66 } catch (\Exception
$e) {
67 fwrite(STDERR
, $e->getMessage() . LF
);
71 \TYPO3\CMS\Core\Core\Bootstrap
::getInstance()->shutdown();