예제 #1
0
 /**
  * Handles a frontend request based on the _GP "eID" variable.
  *
  * @return void
  */
 public function handleRequest()
 {
     // Timetracking started
     $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']);
     if (empty($configuredCookieName)) {
         $configuredCookieName = 'be_typo_user';
     }
     if ($_COOKIE[$configuredCookieName]) {
         $GLOBALS['TT'] = new TimeTracker();
     } else {
         $GLOBALS['TT'] = new NullTimeTracker();
     }
     $GLOBALS['TT']->start();
     // Hook to preprocess the current request
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
             $hookParameters = array();
             GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
         }
         unset($hookFunction);
         unset($hookParameters);
     }
     // Remove any output produced until now
     $this->bootstrap->endOutputBufferingAndCleanPreviousOutput();
     require EidUtility::getEidScriptPath();
     $this->bootstrap->shutdown();
     exit;
 }
예제 #2
0
 /**
  * Set up the application and shut it down afterwards
  * Failsafe minimal setup mode for the install tool
  * Does not call "run()" therefore
  *
  * @param callable $execute
  * @return void
  */
 public function run(callable $execute = null)
 {
     $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals());
     if ($execute !== null) {
         call_user_func($execute);
     }
     $this->bootstrap->shutdown();
 }
예제 #3
0
 /**
  * Set up the application and shut it down afterwards
  *
  * @param callable $execute
  * @return void
  */
 public function run(callable $execute = null)
 {
     $this->bootstrap->handleRequest(new \Symfony\Component\Console\Input\ArgvInput());
     if ($execute !== null) {
         call_user_func($execute);
     }
     $this->bootstrap->shutdown();
 }
예제 #4
0
 /**
  * Run the Symfony Console application in this TYPO3 application
  *
  * @param callable $execute
  * @return void
  */
 public function run(callable $execute = null)
 {
     $this->bootstrap->handleRequest(new ArgvInput());
     if ($execute !== null) {
         call_user_func($execute);
     }
     $this->bootstrap->shutdown();
 }
예제 #5
0
 /**
  * Handles any backend request
  *
  * @return void
  */
 public function handleRequest()
 {
     // Evaluate the constant for skipping the BE user check for the bootstrap
     if (defined('TYPO3_PROCEED_IF_NO_USER') && TYPO3_PROCEED_IF_NO_USER) {
         $proceedIfNoUserIsLoggedIn = TRUE;
     } else {
         $proceedIfNoUserIsLoggedIn = FALSE;
     }
     $this->bootstrap->checkLockedBackendAndRedirectOrDie()->checkBackendIpOrDie()->checkSslBackendAndRedirectIfNeeded()->checkValidBrowserOrDie()->loadExtensionTables(TRUE)->initializeSpriteManager()->initializeBackendUser()->initializeBackendAuthentication($proceedIfNoUserIsLoggedIn)->initializeLanguageObject()->initializeBackendTemplate()->endOutputBufferingAndCleanPreviousOutput()->initializeOutputCompression()->sendHttpHeaders();
 }
예제 #6
0
 /**
  * Set up the application and shut it down afterwards
  *
  * @param callable $execute
  * @return void
  */
 public function run(callable $execute = NULL)
 {
     $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals());
     if ($execute !== NULL) {
         if ($execute instanceof \Closure) {
             $execute->bindTo($this);
         }
         call_user_func($execute);
     }
     $this->bootstrap->shutdown();
 }
예제 #7
0
 /**
  * Set up the application and shut it down afterwards
  *
  * @param callable $execute
  * @return void
  */
 public function run(callable $execute = NULL)
 {
     $this->bootstrap->handleRequest(new \Symfony\Component\Console\Input\ArgvInput());
     if ($execute !== NULL) {
         if ($execute instanceof \Closure) {
             $execute->bindTo($this);
         }
         call_user_func($execute);
     }
     $this->bootstrap->shutdown();
 }
예제 #8
0
 /**
  * Set up the application and shut it down afterwards
  * Failsafe minimal setup mode for the install tool
  * Does not call "run()" therefore
  *
  * @param callable $execute
  * @return void
  */
 public function run(callable $execute = NULL)
 {
     $this->bootstrap->startOutputBuffering()->loadConfigurationAndInitialize(FALSE, \TYPO3\CMS\Core\Package\FailsafePackageManager::class)->handleRequest();
     if ($execute !== NULL) {
         if ($execute instanceof \Closure) {
             $execute->bindTo($this);
         }
         call_user_func($execute);
     }
     $this->bootstrap->shutdown();
 }
예제 #9
0
 /**
  * Set up the application and shut it down afterwards
  *
  * @param callable $execute
  * @return void
  */
 public function run(callable $execute = NULL)
 {
     $this->bootstrap->run();
     if ($execute !== NULL) {
         if ($execute instanceof \Closure) {
             $execute->bindTo($this);
         }
         call_user_func($execute);
     }
     $this->bootstrap->shutdown();
 }
예제 #10
0
 /**
  * Set up the application and shut it down afterwards
  *
  * @param callable $execute
  * @return void
  */
 public function run(callable $execute = null)
 {
     $this->bootstrap->handleRequest($this->request);
     if ($execute !== null) {
         if ($execute instanceof \Closure) {
             $execute->bindTo($this);
         }
         call_user_func($execute);
     }
     $this->bootstrap->shutdown();
 }
예제 #11
0
 /**
  * Execute TYPO3 bootstrap
  */
 protected function boot()
 {
     // Evaluate the constant for skipping the BE user check for the bootstrap
     if (defined('TYPO3_PROCEED_IF_NO_USER') && TYPO3_PROCEED_IF_NO_USER) {
         $proceedIfNoUserIsLoggedIn = TRUE;
     } else {
         $proceedIfNoUserIsLoggedIn = FALSE;
     }
     $this->bootstrap->loadExtensionTables(TRUE)->initializeBackendUser()->initializeBackendAuthentication($proceedIfNoUserIsLoggedIn)->initializeLanguageObject();
     // Make sure output is not buffered, so command-line output and interaction can take place
     GeneralUtility::flushOutputBuffers();
 }
예제 #12
0
 /**
  * Set up the application and shut it down afterwards
  *
  * @param callable $execute
  * @return void
  */
 public function run(callable $execute = null)
 {
     $this->request = \TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals();
     // see below when this option is set and Bootstrap::defineTypo3RequestTypes() for more details
     if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
         $this->request = $this->request->withAttribute('isAjaxRequest', true);
     } elseif (isset($this->request->getQueryParams()['M'])) {
         $this->request = $this->request->withAttribute('isModuleRequest', true);
     }
     $this->bootstrap->handleRequest($this->request);
     if ($execute !== null) {
         call_user_func($execute);
     }
     $this->bootstrap->shutdown();
 }
예제 #13
0
 /**
  * Execute environment and folder step:
  * - Create main folder structure
  * - Create typo3conf/LocalConfiguration.php
  *
  * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
  */
 public function execute()
 {
     /** @var $folderStructureFactory \TYPO3\CMS\Install\FolderStructure\DefaultFactory */
     $folderStructureFactory = $this->objectManager->get(\TYPO3\CMS\Install\FolderStructure\DefaultFactory::class);
     /** @var $structureFacade \TYPO3\CMS\Install\FolderStructure\StructureFacade */
     $structureFacade = $folderStructureFactory->getStructure();
     $structureFixMessages = $structureFacade->fix();
     /** @var \TYPO3\CMS\Install\Status\StatusUtility $statusUtility */
     $statusUtility = $this->objectManager->get(\TYPO3\CMS\Install\Status\StatusUtility::class);
     $errorsFromStructure = $statusUtility->filterBySeverity($structureFixMessages, 'error');
     if (@is_dir(PATH_typo3conf)) {
         /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
         $configurationManager = $this->objectManager->get(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class);
         $configurationManager->createLocalConfigurationFromFactoryConfiguration();
         // Create a PackageStates.php with all packages activated marked as "part of factory default"
         if (!file_exists(PATH_typo3conf . 'PackageStates.php')) {
             /** @var \TYPO3\CMS\Core\Package\FailsafePackageManager $packageManager */
             $packageManager = \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getEarlyInstance(\TYPO3\CMS\Core\Package\PackageManager::class);
             $packages = $packageManager->getAvailablePackages();
             foreach ($packages as $package) {
                 /** @var $package \TYPO3\CMS\Core\Package\PackageInterface */
                 if ($package instanceof \TYPO3\CMS\Core\Package\PackageInterface && $package->isPartOfFactoryDefault()) {
                     $packageManager->activatePackage($package->getPackageKey());
                 }
             }
             $packageManager->forceSortAndSavePackageStates();
         }
         // Create enable install tool file after typo3conf & LocalConfiguration were created
         /** @var \TYPO3\CMS\Install\Service\EnableFileService $installToolService */
         $installToolService = $this->objectManager->get(\TYPO3\CMS\Install\Service\EnableFileService::class);
         $installToolService->removeFirstInstallFile();
         $installToolService->createInstallToolEnableFile();
     }
     return $errorsFromStructure;
 }
 /**
  * Returns a valid DatabaseConnection object that is connected and ready
  * to be used static
  *
  * @return \TYPO3\CMS\Core\Database\DatabaseConnection
  */
 public static function getDatabaseConnection()
 {
     if (!$GLOBALS['TYPO3_DB']) {
         \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeTypo3DbGlobal();
     }
     return $GLOBALS['TYPO3_DB'];
 }
예제 #15
0
 /**
  * @return $this
  */
 public function initializeCmsContext()
 {
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->baseSetup('typo3/')->initializeClassLoader()->initializeCachingFramework()->initializePackageManagement('FluidTYPO3\\Development\\NullPackageManager');
     $container = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\Container\\Container');
     $this->setObjectContainer($container);
     return $this;
 }
예제 #16
0
 /**
  * @param array $ajaxParams
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObject
  * @return string
  */
 public function updateConfigurationFile($ajaxParams, $ajaxObject)
 {
     $extensionKey = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('extensionKey');
     if (!empty($extensionKey)) {
         $packageManager = \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getEarlyInstance('TYPO3\\Flow\\Package\\PackageManager');
         $extensionConfigurationPath = $packageManager->getPackage($extensionKey)->getPackagePath() . 'ext_emconf.php';
         $_EXTKEY = $extensionKey;
         $EM_CONF = NULL;
         $extension = NULL;
         if (file_exists($extensionConfigurationPath)) {
             include $extensionConfigurationPath;
             if (is_array($EM_CONF[$_EXTKEY])) {
                 $extension = $EM_CONF[$_EXTKEY];
             }
         }
         if ($EM_CONF !== NULL) {
             $currentMd5HashArray = \IchHabRecht\Devtools\Utility\ExtensionUtility::getMd5HashArrayForExtension($extensionKey);
             $EM_CONF[$extensionKey]['_md5_values_when_last_written'] = serialize($currentMd5HashArray);
             /** @var \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility */
             $emConfUtility = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\\TYPO3\\CMS\\Extensionmanager\\Utility\\EmConfUtility');
             $extensionData = array('extKey' => $extensionKey, 'EM_CONF' => $EM_CONF[$extensionKey]);
             $emConfContent = $emConfUtility->constructEmConf($extensionData);
             \TYPO3\CMS\Core\Utility\GeneralUtility::writeFile($extensionConfigurationPath, $emConfContent);
         }
         $ajaxObject->setContentFormat('json');
         $ajaxObject->addContent('title', $this->translate('title'));
         $ajaxObject->addContent('message', sprintf($this->translate('message'), $extensionKey));
     }
 }
 /**
  * This clear cache implementation follows a pretty brutal approach.
  * Goal is to reliably get rid of cache entries, even if some broken
  * extension is loaded that would kill the backend 'clear cache' action.
  *
  * Therefor this method "knows" implementation details of the cache
  * framework and uses them to clear all file based cache (typo3temp/Cache)
  * and database caches (tables prefixed with cf_) manually.
  *
  * After that ext_tables and ext_localconf of extensions are loaded, those
  * may register additional caches in the caching framework with different
  * backend, and will then clear them with the usual flush() method.
  *
  * @return void
  */
 public function clearAll()
 {
     // Delete typo3temp/Cache
     GeneralUtility::flushDirectory(PATH_site . 'typo3temp/var/Cache', true, true);
     $bootstrap = \TYPO3\CMS\Core\Core\Bootstrap::getInstance();
     $bootstrap->initializeCachingFramework()->initializePackageManagement(\TYPO3\CMS\Core\Package\PackageManager::class);
     // Get all table names starting with 'cf_' and truncate them
     $database = $this->getDatabaseConnection();
     $tables = $database->admin_get_tables();
     foreach ($tables as $table) {
         $tableName = $table['Name'];
         if (substr($tableName, 0, 3) === 'cf_') {
             $database->exec_TRUNCATEquery($tableName);
         } elseif ($tableName === 'cache_treelist') {
             // cache_treelist is not implemented in the caching framework.
             // clear this table manually
             $database->exec_TRUNCATEquery('cache_treelist');
         }
     }
     // From this point on, the code may fatal, if some broken extension is loaded.
     // Use bootstrap to load all ext_localconf and ext_tables
     $bootstrap->loadTypo3LoadedExtAndExtLocalconf(false)->defineLoggingAndExceptionConstants()->unsetReservedGlobalVariables()->initializeTypo3DbGlobal()->loadExtensionTables(false);
     // The cache manager is already instantiated in the install tool
     // with some hacked settings to disable caching of extbase and fluid.
     // We want a "fresh" object here to operate on a different cache setup.
     // cacheManager implements SingletonInterface, so the only way to get a "fresh"
     // instance is by circumventing makeInstance and/or the objectManager and
     // using new directly!
     $cacheManager = new \TYPO3\CMS\Core\Cache\CacheManager();
     $cacheManager->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
     // Cache manager needs cache factory. cache factory injects itself to manager in __construct()
     new \TYPO3\CMS\Core\Cache\CacheFactory('production', $cacheManager);
     $cacheManager->flushCaches();
 }
예제 #18
0
 /**
  * This clear cache implementation follows a pretty brutal approach.
  * Goal is to reliably get rid of cache entries, even if some broken
  * extension is loaded that would kill the backend 'clear cache' action.
  *
  * Therefor this method "knows" implementation details of the cache
  * framework and uses them to clear all file based cache (typo3temp/Cache)
  * and database caches (tables prefixed with cf_) manually.
  *
  * After that ext_tables and ext_localconf of extensions are loaded, those
  * may register additional caches in the caching framework with different
  * backend, and will then clear them with the usual flush() method.
  *
  * @return void
  */
 public function clearAll()
 {
     // Delete typo3temp/Cache
     GeneralUtility::flushDirectory(PATH_site . 'typo3temp/var/Cache', true, true);
     $bootstrap = \TYPO3\CMS\Core\Core\Bootstrap::getInstance();
     $bootstrap->initializeCachingFramework()->initializePackageManagement(\TYPO3\CMS\Core\Package\PackageManager::class);
     // Get all table names from Default connection starting with 'cf_' and truncate them
     $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
     $connection = $connectionPool->getConnectionByName('Default');
     $tables = $connection->getSchemaManager()->listTables();
     foreach ($tables as $table) {
         if (strpos($table->getName(), 'cf_') === 0 || $table->getName() === 'cache_treelist') {
             $connection->truncate($table->getName());
         }
     }
     // check tables on other connections
     $remappedTables = isset($GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']) ? array_keys((array) $GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']) : [];
     foreach ($remappedTables as $tableName) {
         if (strpos((string) $tableName, 'cf_') === 0 || $tableName === 'cache_treelist') {
             $connectionPool->getConnectionForTable($tableName)->truncate($tableName);
         }
     }
     // From this point on, the code may fatal, if some broken extension is loaded.
     // Use bootstrap to load all ext_localconf and ext_tables
     $bootstrap->loadTypo3LoadedExtAndExtLocalconf(false)->defineLoggingAndExceptionConstants()->unsetReservedGlobalVariables()->initializeTypo3DbGlobal()->loadExtensionTables(false);
     // The cache manager is already instantiated in the install tool
     // with some hacked settings to disable caching of extbase and fluid.
     // We want a "fresh" object here to operate on a different cache setup.
     // cacheManager implements SingletonInterface, so the only way to get a "fresh"
     // instance is by circumventing makeInstance and/or the objectManager and
     // using new directly!
     $cacheManager = new \TYPO3\CMS\Core\Cache\CacheManager();
     $cacheManager->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
     $cacheManager->flushCaches();
 }
예제 #19
0
 /**
  * @return void
  */
 public function execute()
 {
     // check for the Bootstrap class to check if the current TYPO3 version meets our requirements
     if (class_exists('TYPO3\\CMS\\Core\\Core\\Bootstrap')) {
         /** @var \TYPO3\CMS\Install\Sql\SchemaMigrator $schemaMigrator */
         $schemaMigrator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Install\\Sql\\SchemaMigrator');
         /** @var \TYPO3\CMS\Core\Database\DatabaseConnection $databaseConnection */
         $databaseConnection = $GLOBALS['TYPO3_DB'];
         \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(FALSE);
         $tableDefinitionsString = $this->resolveTableDefinitions();
         $currentFieldDefinitions = $schemaMigrator->getFieldDefinitions_database();
         $updatedFieldDefinitions = $schemaMigrator->getFieldDefinitions_fileContent($tableDefinitionsString);
         $fieldDefinitionsDifferences = $schemaMigrator->getDatabaseExtra($updatedFieldDefinitions, $currentFieldDefinitions);
         $updateStatements = $schemaMigrator->getUpdateSuggestions($fieldDefinitionsDifferences);
         $allowedStatementTypes = array('add', 'create_table');
         if (!empty($updateStatements)) {
             $this->messageService->warningMessage('Difference detected in table definitions. Statement types: ' . implode(',', array_keys($updateStatements)), TRUE);
             foreach ($allowedStatementTypes as $statementType) {
                 if (array_key_exists($statementType, $updateStatements) && is_array($updateStatements[$statementType])) {
                     foreach ($updateStatements[$statementType] as $statement) {
                         $this->messageService->infoMessage('Executing "' . $statement . '"');
                         $result = $databaseConnection->admin_query($statement);
                         if ($result !== TRUE) {
                             $this->messageService->warningMessage('Executing query failed!');
                         }
                     }
                 }
             }
         }
     }
 }
 /**
  * Generates the action menu
  *
  * @return void
  */
 protected function generateMenu()
 {
     $menuItems = ['installedExtensions' => ['controller' => 'List', 'action' => 'index', 'label' => $this->translate('installedExtensions')]];
     if (!$this->settings['offlineMode'] && !Bootstrap::usesComposerClassLoading()) {
         $menuItems['getExtensions'] = ['controller' => 'List', 'action' => 'ter', 'label' => $this->translate('getExtensions')];
         $menuItems['distributions'] = ['controller' => 'List', 'action' => 'distributions', 'label' => $this->translate('distributions')];
         if ($this->actionMethodName === 'showAllVersionsAction') {
             $menuItems['showAllVersions'] = ['controller' => 'List', 'action' => 'showAllVersions', 'label' => $this->translate('showAllVersions') . ' ' . $this->request->getArgument('extensionKey')];
         }
     }
     $uriBuilder = $this->objectManager->get(UriBuilder::class);
     $uriBuilder->setRequest($this->request);
     $menu = $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
     $menu->setIdentifier('ExtensionManagerModuleMenu');
     foreach ($menuItems as $menuItemConfig) {
         if ($this->request->getControllerName() === $menuItemConfig['controller']) {
             $isActive = $this->request->getControllerActionName() === $menuItemConfig['action'] ? true : false;
         } else {
             $isActive = false;
         }
         $menuItem = $menu->makeMenuItem()->setTitle($menuItemConfig['label'])->setHref($this->getHref($menuItemConfig['controller'], $menuItemConfig['action']))->setActive($isActive);
         $menu->addMenuItem($menuItem);
     }
     $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
     $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
 }
 /**
  * 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();
 }
예제 #22
0
 /**
  * Set up
  */
 protected function setUp()
 {
     parent::setUp();
     $this->setUpBackendUserFromFixture(1);
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject();
     $this->importDataSet(__DIR__ . '/../Fixtures/sys_workspace.xml');
 }
예제 #23
0
 /**
  * Handles any backend request
  *
  * @param \Psr\Http\Message\ServerRequestInterface $request
  * @return NULL|\Psr\Http\Message\ResponseInterface
  */
 public function handleRequest(\Psr\Http\Message\ServerRequestInterface $request)
 {
     // enable dispatching via Request/Response logic only for typo3/index.php currently
     $path = substr($request->getUri()->getPath(), strlen(GeneralUtility::getIndpEnv('TYPO3_SITE_PATH')));
     $routingEnabled = $path === TYPO3_mainDir . 'index.php' || $path === TYPO3_mainDir;
     // Evaluate the constant for skipping the BE user check for the bootstrap
     if (defined('TYPO3_PROCEED_IF_NO_USER') && TYPO3_PROCEED_IF_NO_USER) {
         $proceedIfNoUserIsLoggedIn = TRUE;
     } else {
         $proceedIfNoUserIsLoggedIn = FALSE;
     }
     $this->bootstrap->checkLockedBackendAndRedirectOrDie()->checkBackendIpOrDie()->checkSslBackendAndRedirectIfNeeded()->checkValidBrowserOrDie()->loadExtensionTables(TRUE)->initializeSpriteManager()->initializeBackendUser()->initializeBackendAuthentication($proceedIfNoUserIsLoggedIn)->initializeLanguageObject()->initializeBackendTemplate()->endOutputBufferingAndCleanPreviousOutput()->initializeOutputCompression()->sendHttpHeaders();
     if ($routingEnabled) {
         return $this->dispatch($request);
     }
     return NULL;
 }
 /**
  * Set up for set up the backend user, initialize the language object
  * and creating the Export instance
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->setUpBackendUserFromFixture(1);
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject();
     $this->export = GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\Export::class);
     $this->export->init(0, 'export');
 }
예제 #25
0
 /**
  * @return bool
  */
 public static function isFirstInstallAllowed()
 {
     $files = self::getFirstInstallFilePaths();
     if (!empty($files) && !\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->checkIfEssentialConfigurationExists()) {
         return true;
     }
     return false;
 }
예제 #26
0
 /**
  * Return 'this' as singleton
  *
  * @return Bootstrap
  * @internal This is not a public API method, do not use in own extensions
  */
 public static function getInstance()
 {
     if (is_null(static::$instance)) {
         $applicationContext = getenv('TYPO3_CONTEXT') ?: (getenv('REDIRECT_TYPO3_CONTEXT') ?: 'Production');
         self::$instance = new static($applicationContext);
         self::$instance->defineTypo3RequestTypes();
     }
     return static::$instance;
 }
 protected function setUp()
 {
     parent::setUp();
     $this->backendUser = $this->setUpBackendUserFromFixture(self::VALUE_BackendUserId);
     // By default make tests on live workspace
     $this->backendUser->workspace = 0;
     $this->actionService = $this->getActionService();
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject();
 }
예제 #28
0
 /**
  * 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();
 }
예제 #29
0
 /**
  * Sets up this test case.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->setUpBackendUserFromFixture(1);
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject();
     $this->expectedLogEntries = 0;
     $GLOBALS['TYPO3_CONF_VARS']['SYS']['sqlDebug'] = 1;
     $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/pages.xml');
     $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/sys_language.xml');
 }
 /**
  * Execute TYPO3 bootstrap
  *
  * @return void
  */
 protected function boot()
 {
     // Evaluate the constant for skipping the BE user check for the bootstrap, will be done without the constant at a later point
     if (defined('TYPO3_PROCEED_IF_NO_USER') && TYPO3_PROCEED_IF_NO_USER) {
         $proceedIfNoUserIsLoggedIn = true;
     } else {
         $proceedIfNoUserIsLoggedIn = false;
     }
     $this->bootstrap->checkLockedBackendAndRedirectOrDie()->checkBackendIpOrDie()->checkSslBackendAndRedirectIfNeeded()->initializeBackendRouter()->loadExtensionTables(true)->initializeSpriteManager()->initializeBackendUser()->initializeBackendAuthentication($proceedIfNoUserIsLoggedIn)->initializeLanguageObject()->initializeBackendTemplate()->endOutputBufferingAndCleanPreviousOutput()->initializeOutputCompression()->sendHttpHeaders();
 }