/** * 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']; }
/** * @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)); } }
/** * 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; }
/** * @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; }
/** * 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(); }
/** * Set up */ protected function setUp() { parent::setUp(); $this->setUpBackendUserFromFixture(1); \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject(); $this->importDataSet(__DIR__ . '/../Fixtures/sys_workspace.xml'); }
/** * @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!'); } } } } } } }
/** * 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(); }
/** * @return bool */ public static function isFirstInstallAllowed() { $files = self::getFirstInstallFilePaths(); if (!empty($files) && !\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->checkIfEssentialConfigurationExists()) { return true; } return false; }
/** * Constructor setting up legacy constant and register available Request Handlers * * @param \Composer\Autoload\ClassLoader|\Helhum\ClassAliasLoader\Composer\ClassAliasLoader $classLoader an instance of the class loader */ public function __construct($classLoader) { $this->defineLegacyConstants(); $this->bootstrap = Bootstrap::getInstance()->initializeClassLoader($classLoader)->baseSetup($this->entryPointPath); foreach ($this->availableRequestHandlers as $requestHandler) { $this->bootstrap->registerRequestHandlerImplementation($requestHandler); } }
/** * 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'); }
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(); }
/** * Constructor setting up legacy constant and register available Request Handlers * * @param \Composer\Autoload\ClassLoader $classLoader an instance of the class loader */ public function __construct($classLoader) { $this->defineLegacyConstants(); $this->bootstrap = Bootstrap::getInstance()->initializeClassLoader($classLoader)->baseSetup($this->entryPointPath); foreach ($this->availableRequestHandlers as $requestHandler) { $this->bootstrap->registerRequestHandlerImplementation($requestHandler); } $this->bootstrap->startOutputBuffering()->loadConfigurationAndInitialize(false, \TYPO3\CMS\Core\Package\FailsafePackageManager::class); }
/** * Set up for set up the backend user, initialize the language object * and creating the ImportExport instance * * @return void */ protected function setUp() { parent::setUp(); $this->setUpBackendUserFromFixture(1); // Needed to avoid PHP Warnings $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'] = array(); \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject(); $this->export = GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\ImportExport::class); $this->export->init(0, 'export'); }
/** * Constructor setting up legacy constants and register available Request Handlers * * @param \Composer\Autoload\ClassLoader $classLoader an instance of the class loader */ public function __construct($classLoader) { $this->checkEnvironmentOrDie(); $this->defineLegacyConstants(); $this->bootstrap = Bootstrap::getInstance()->initializeClassLoader($classLoader)->setRequestType(TYPO3_REQUESTTYPE_BE | TYPO3_REQUESTTYPE_CLI)->baseSetup($this->entryPointLevel); foreach ($this->availableRequestHandlers as $requestHandler) { $this->bootstrap->registerRequestHandlerImplementation($requestHandler); } $this->bootstrap->configure(); }
/** * Makes TCA available inside eID * * @return void */ public static function initTCA() { // Some badly made extensions attempt to manipulate TCA in a wrong way // (inside ext_localconf.php). Therefore $GLOBALS['TCA'] may become an array // but in fact it is not loaded. The check below ensure that // TCA is still loaded if such bad extensions are installed if (!is_array($GLOBALS['TCA']) || !isset($GLOBALS['TCA']['pages'])) { Bootstrap::getInstance()->loadCachedTca(); } }
/** * Sets up this test case. * * @return void */ protected function setUp() { parent::setUp(); $this->setUpBackendUserFromFixture(1); Bootstrap::getInstance()->initializeLanguageObject(); $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/backend/Tests/Functional/Fixtures/pages.xml'); $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/sys_language.xml'); $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/backend/Tests/Functional/Controller/Page/Fixtures/tt_content-default-language.xml'); $this->subject = new LocalizationController(); }
/** * Constructor setting up legacy constants and register available Request Handlers * * @param \Composer\Autoload\ClassLoader|\Helhum\ClassAliasLoader\Composer\ClassAliasLoader $classLoader an instance of the class loader */ public function __construct($classLoader) { $this->defineLegacyConstants(); \TYPO3\CMS\Core\Core\CliBootstrap::checkEnvironmentOrDie(); $this->bootstrap = Bootstrap::getInstance()->initializeClassLoader($classLoader)->baseSetup($this->entryPointPath); foreach ($this->availableRequestHandlers as $requestHandler) { $this->bootstrap->registerRequestHandlerImplementation($requestHandler); } $this->bootstrap->configure(); }
/** * 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'); }
/** * @throws \TYPO3\CMS\Core\Tests\Exception */ public function setUp() { parent::setUp(); $this->setUpBackendUserFromFixture(1); \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject(); $this->importDataSet(__DIR__ . '/Fixtures/Database/be_users.xml'); $this->importDataSet(__DIR__ . '/Fixtures/Database/pages.xml'); $this->importDataSet(__DIR__ . '/Fixtures/Database/tt_content.xml'); $this->importDataSet(__DIR__ . '/Fixtures/Database/sys_category.xml'); $this->importDataSet(__DIR__ . '/Fixtures/Database/sys_category_record_mm.xml'); $this->importDataSet(__DIR__ . '/Fixtures/Database/tx_kesearch_indexerconfig.xml'); }
/** * Constructor setting up legacy constant and register available Request Handlers * * @param \Composer\Autoload\ClassLoader|\Helhum\ClassAliasLoader\Composer\ClassAliasLoader $classLoader an instance of the class loader */ public function __construct($classLoader) { $this->defineLegacyConstants(); $this->bootstrap = Bootstrap::getInstance()->initializeClassLoader($classLoader)->baseSetup($this->entryPointPath); // Redirect to install tool if base configuration is not found if (!$this->bootstrap->checkIfEssentialConfigurationExists()) { $this->bootstrap->redirectToInstallTool($this->entryPointPath); } foreach ($this->availableRequestHandlers as $requestHandler) { $this->bootstrap->registerRequestHandlerImplementation($requestHandler); } }
/** * Constructor setting up legacy constant and register available Request Handlers * * @param \Composer\Autoload\ClassLoader $classLoader an instance of the class loader */ public function __construct($classLoader) { $this->defineLegacyConstants(); $this->bootstrap = Bootstrap::getInstance()->initializeClassLoader($classLoader)->setRequestType(TYPO3_REQUESTTYPE_BE | (!empty($_GET['ajaxID']) ? TYPO3_REQUESTTYPE_AJAX : 0))->baseSetup($this->entryPointLevel); // Redirect to install tool if base configuration is not found if (!$this->bootstrap->checkIfEssentialConfigurationExists()) { $this->bootstrap->redirectToInstallTool($this->entryPointLevel); } foreach ($this->availableRequestHandlers as $requestHandler) { $this->bootstrap->registerRequestHandlerImplementation($requestHandler); } $this->bootstrap->configure(); }
/** * Initializes TSFE and sets $GLOBALS['TSFE'] * * @return void */ protected function initTSFE() { $GLOBALS['TSFE'] = $tsfe = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], GeneralUtility::_GP('id'), ''); /** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $tsfe */ $tsfe->connectToDB(); $tsfe->initFEuser(); \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca(); $tsfe->determineId(); $tsfe->initTemplate(); $tsfe->getConfigArray(); // Get linkVars, absRefPrefix, etc \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit(); }
/** * Guard method checking typo3conf/ENABLE_INSTALL_TOOL * * Checking ENABLE_INSTALL_TOOL validity is simple: * As soon as there is a typo3conf directory at all (not step 1 of "first install"), * the file must be there and valid in order to proceed. * * @return void */ protected function outputInstallToolNotEnabledMessageIfNeeded() { if (!$this->isInstallToolAvailable()) { if (!EnableFileService::isFirstInstallAllowed() && !\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->checkIfEssentialConfigurationExists()) { /** @var \TYPO3\CMS\Install\Controller\Action\ActionInterface $action */ $action = $this->objectManager->get(\TYPO3\CMS\Install\Controller\Action\Common\FirstInstallAction::class); $action->setAction('firstInstall'); } else { /** @var \TYPO3\CMS\Install\Controller\Action\ActionInterface $action */ $action = $this->objectManager->get(\TYPO3\CMS\Install\Controller\Action\Common\InstallToolDisabledAction::class); $action->setAction('installToolDisabled'); } $action->setController('common'); $this->output($action->handle()); } }
/** * Fix a race condition that GeneralUtility is not available * during tearDown if fiddling with the autoloader where * backupGlobals is not set up again yet */ public function setUp() { vfsStream::setup('Test'); mkdir('vfs://Test/Packages/Application/Acme.MyApp/Classes/', 0770, TRUE); file_put_contents('vfs://Test/Packages/Application/Acme.MyApp/composer.json', '{"name": "acme/myapp", "type": "flow-test"}'); $package1 = new \TYPO3\Flow\Package\Package($this->getMock('TYPO3\\Flow\\Package\\PackageManager'), 'Acme.MyApp', 'vfs://Test/Packages/Application/Acme.MyApp/', 'Classes'); mkdir('vfs://Test/Packages/Application/Acme.MyAppAddon/Classes/', 0770, TRUE); file_put_contents('vfs://Test/Packages/Application/Acme.MyAppAddon/composer.json', '{"name": "acme/myappaddon", "type": "flow-test"}'); $package2 = new \TYPO3\Flow\Package\Package($this->getMock('TYPO3\\Flow\\Package\\PackageManager'), 'Acme.MyAppAddon', 'vfs://Test/Packages/Application/Acme.MyAppAddon/', 'Classes'); $mockClassAliasMap = $this->getMock('TYPO3\\CMS\\Core\\Core\\ClassAliasMap', array('setPackagesButDontBuildMappingFilesReturnClassNameToAliasMappingInstead', 'buildMappingFiles'), array(), '', FALSE); $mockClassAliasMap->expects($this->any())->method('setPackagesButDontBuildMappingFilesReturnClassNameToAliasMappingInstead')->will($this->returnValue(array())); $this->orinalClassAliasMap = \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getEarlyInstance('TYPO3\\CMS\\Core\\Core\\ClassAliasMap'); $this->classLoader = new \TYPO3\CMS\Core\Core\ClassLoader(\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getApplicationContext()); $this->classLoader->injectClassAliasMap($mockClassAliasMap); $this->classLoader->setPackages(array('Acme.MyApp' => $package1, 'Acme.MyAppAddon' => $package2)); }
/** * @param array $settings * @param \TYPO3\CMS\Extensionmanager\Controller\ConfigurationController $controller * @return void */ protected function doProcess(array $settings, \TYPO3\CMS\Extensionmanager\Controller\ConfigurationController $controller) { $this->settings = $this->remapSettings($settings); if (TRUE === isset($this->settings['kickstart']) && TRUE === (bool) $this->settings['kickstart']) { if (TRUE === \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($this->settings['extensionKey'])) { return; } $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['core'] = array('backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend'); \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeClassLoader()->disableCoreAndClassesCache(); if (TRUE === \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('css_styled_content')) { $this->deleteExtensionAndFiles('css_styled_content'); } $this->kickstartProviderExtension($this->settings['extensionKey']); if (TRUE === (bool) $this->settings['makeResources']) { $topPageUid = $this->createPageResources($this->settings['extensionKey']); } else { $topPageUid = reset($GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid', 'pages', "pid = '0'")); } $this->createTypoScriptTemplate($topPageUid, $this->settings['extensionKey']); if (TRUE === (bool) $this->settings['makeMountPoint']) { $this->createMountPoint($this->settings['extensionKey']); } $this->createDomainRecord($topPageUid); $copiedConfiguration = $this->copyFluidContentCoreConfiguration(); if (FALSE === $copiedConfiguration) { $controller->addFlashMessage('The FluidcontentCore "AdditionalConfiguration.php" file was *NOT* copied to typo3conf. It appears you already have this file and we do not wish to overwrite it. Please consult the README .md file that is shipped with EXT:fluidcontent_core for manual install instructions!', '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR); } $mass = $this->settings['mass']; foreach ($this->extensionRemovals[$mass] as $removeExtensionKey) { $this->uninstallExtension($removeExtensionKey); } foreach ($this->extensionAdditions[$mass] as $installExtensionKey) { $this->installExtension($installExtensionKey); } $this->cleanup(); $controller->addFlashMessage('The steps you selected in your configuration have been performed: your Provider Extension is now ready for use and can be accessed in the extension folder or through the file list module if you selected to create a file mount point.'); $controller->addFlashMessage('EXT:site self-destructed; re-download if you need to kickstart another site in this TYPO3 installation!'); header('Location: ?M=tools_ExtensionmanagerExtensionmanager&moduleToken=' . \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('moduleToken')); exit; } }
/** * Build up the TSFE */ public function buildFrontend() { global $TSFE; EidUtility::initLanguage(); /** @var TypoScriptFrontendController $TSFE */ $TSFE = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], 0, 0); EidUtility::initLanguage(); // Get FE User Information $TSFE->initFEuser(); // Important: no Cache for Ajax stuff $TSFE->set_no_cache(); $TSFE->initTemplate(); // $TSFE->getConfigArray(); Bootstrap::getInstance()->loadCachedTca(); $TSFE->cObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'); $TSFE->settingLanguage(); $TSFE->settingLocale(); }
/** * Boostrap of Typo3 for eID environment */ public static function initEnvironment() { /* @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */ $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, $GLOBALS['TYPO3_CONF_VARS'], null, 0); \TYPO3\CMS\Frontend\Utility\EidUtility::initLanguage(); $GLOBALS['TSFE']->connectToDB(); $GLOBALS['TSFE']->initFEuser(); $GLOBALS['TSFE']->initUserGroups(); \TYPO3\CMS\Frontend\Utility\EidUtility::initTCA(); $GLOBALS['TSFE']->checkAlternativeIdMethods(); $GLOBALS['TSFE']->clear_preview(); $GLOBALS['TSFE']->determineId(); $GLOBALS['TSFE']->initTemplate(); $GLOBALS['TSFE']->getConfigArray(); $GLOBALS['TSFE']->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class); $GLOBALS['TSFE']->settingLanguage(); $GLOBALS['TSFE']->settingLocale(); \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca(); }
/** * Constructor setting up legacy constant and register available Request Handlers * * @param \Composer\Autoload\ClassLoader $classLoader an instance of the class loader */ public function __construct($classLoader) { $this->defineLegacyConstants(); $this->bootstrap = Bootstrap::getInstance()->initializeClassLoader($classLoader)->baseSetup($this->entryPointPath); // can be done here after the base setup is done $this->defineAdditionalEntryPointRelatedConstants(); // Redirect to install tool if base configuration is not found if (!$this->bootstrap->checkIfEssentialConfigurationExists()) { $this->bootstrap->redirectToInstallTool($this->entryPointPath); } foreach ($this->availableRequestHandlers as $requestHandler) { $this->bootstrap->registerRequestHandlerImplementation($requestHandler); } $this->request = \TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals(); // see below when this option is set if ($GLOBALS['TYPO3_AJAX']) { $this->request = $this->request->withAttribute('isAjaxRequest', true); } elseif (isset($this->request->getQueryParams()['M'])) { $this->request = $this->request->withAttribute('isModuleRequest', true); } $this->bootstrap->configure(); }
/** * Build the query (fill the query array) */ public function buildQuery() { if (!empty($this->config['sqlfields'])) { // we need to have the uid if (!\TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->config['sqlfields'], 'uid')) { $this->query['SELECT'] = 'uid,' . $this->config['sqlfields']; } else { $this->query['SELECT'] = $this->config['sqlfields']; } } else { $this->query['SELECT'] = '*'; } $this->query['FROM'] = $this->config['sqltable']; $this->query['WHERE'] = '1=1 AND deleted=0'; $this->query['WHERE'] .= $this->config['extrawhere'] != '' ? ' ' . $this->config['extrawhere'] : ''; $this->query['GROUPBY'] = $this->config['extragroupby'] != '' ? $this->config['extragroupby'] : ''; $this->query['ORDERBY'] = $this->config['extraorderby'] != '' ? $this->config['extraorderby'] : ''; $this->query['LIMIT'] = $this->config['extralimit'] != '' ? $this->config['extralimit'] : ''; if (!isset($GLOBALS['TCA'][$this->config['sqltable']])) { \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca(); } }