/** * Execute TYPO3 bootstrap * * @throws \RuntimeException when the _CLI_ user cannot be authenticated properly */ protected function boot($commandLineName) { $this->bootstrap->loadExtensionTables()->initializeBackendUser(); // Checks for a user called starting with _CLI_ e.g. "_CLI_lowlevel" $this->loadCommandLineBackendUser($commandLineName); $this->bootstrap->initializeBackendAuthentication()->initializeLanguageObject()->endOutputBufferingAndCleanPreviousOutput(); }
/** * If the backend script is in CLI mode, it will try to load a backend user named by the CLI module name (in lowercase) * * @param string $userName the name of the module registered inside $TYPO3_CONF_VARS[SC_OPTIONS][GLOBAL][cliKeys] as second parameter * @throws \RuntimeException if a non-admin Backend user could not be loaded */ protected function initializeBackendUser($userName) { $this->bootstrap->initializeBackendUser(); $GLOBALS['BE_USER']->setBeUserByName($userName); if (!$GLOBALS['BE_USER']->user['uid']) { throw new \RuntimeException('No backend user named "' . $userName . '" was found!', 1476107260); } $this->bootstrap->initializeBackendAuthentication()->initializeLanguageObject(); }
/** * Execute TYPO3 bootstrap * * @throws \RuntimeException when the _CLI_ user cannot be authenticated properly */ protected function boot($commandLineName) { $this->bootstrap->loadExtensionTables()->initializeBackendUser(); // Checks for a user called starting with _CLI_ e.g. "_CLI_lowlevel" $this->loadCommandLineBackendUser($commandLineName); $this->bootstrap->initializeBackendAuthentication()->initializeLanguageObject(); // Make sure output is not buffered, so command-line output and interaction can take place GeneralUtility::flushOutputBuffers(); }