function execute($commands_array) { // init cObj so that the template parser works inside the cli /* @var $cObj tslib_cObj */ chdir(PATH_site); if (!$GLOBALS['TSFE'] instanceof tslib_fe) { $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], 0, 0); $GLOBALS['TSFE']->config['config']['language'] = null; $GLOBALS['TSFE']->initTemplate(); } if (!isset($GLOBALS['TT'])) { $GLOBALS['TT'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_TimeTrackNull'); } $GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site; $this->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_cObj'); switch ($commands_array['action']) { case 'rebuild_flat_database': mslib_befe::rebuildFlatDatabase(); break; } // hook if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/cli/multishop.php']['cli_cron'])) { $params = array('commands_array' => &$commands_array); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/cli/multishop.php']['cli_cron'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } }
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } set_time_limit(86400); ignore_user_abort(true); mslib_befe::rebuildFlatDatabase(); $content .= 'Flat database created.';