/** * clear Cache ajax handler * * @param array $ajaxParams * @param AjaxRequestHandler $ajaxObj */ public function clear($ajaxParams, AjaxRequestHandler $ajaxObj) { if ($this->isProduction() || !$this->isAdmin()) { return; } /** @var \TYPO3\CMS\Core\Cache\CacheManager $cacheManager */ $cacheManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager'); $cacheManager->getCache('autoloader')->flush(); // Dump new class loading information if (GeneralUtility::compat_version('7.0') && !\TYPO3\CMS\Core\Core\Bootstrap::usesComposerClassLoading()) { ClassLoadingInformation::dumpClassLoadingInformation(); } }
/** * Writes class loading information if not yet present * * @return Bootstrap * @internal This is not a public API method, do not use in own extensions */ public function ensureClassLoadingInformationExists() { if (!self::$usesComposerClassLoading && !ClassLoadingInformation::isClassLoadingInformationAvailable()) { ClassLoadingInformation::dumpClassLoadingInformation(); ClassLoadingInformation::registerClassLoadingInformation(); } return $this; }
call_user_func(function () { $testbase = new \TYPO3\CMS\Core\Tests\Testbase(); $testbase->enableDisplayErrors(); $testbase->defineBaseConstants(); $testbase->defineSitePath(); $testbase->defineTypo3ModeBe(); $testbase->setTypo3TestingContext(); $testbase->createDirectory(PATH_site . 'typo3conf/ext'); $testbase->createDirectory(PATH_site . 'typo3temp/assets'); $testbase->createDirectory(PATH_site . 'typo3temp/var/tests'); $testbase->createDirectory(PATH_site . 'typo3temp/var/transient'); $testbase->createDirectory(PATH_site . 'uploads'); // Retrieve an instance of class loader and inject to core bootstrap $classLoaderFilepath = __DIR__ . '/../../../../vendor/autoload.php'; if (!file_exists($classLoaderFilepath)) { die('ClassLoader can\'t be loaded. Please check your path or set an environment variable \'TYPO3_PATH_WEB\' to your root path.'); } $classLoader = (require $classLoaderFilepath); \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeClassLoader($classLoader)->setRequestType(TYPO3_REQUESTTYPE_BE | TYPO3_REQUESTTYPE_CLI)->baseSetup(); // Initialize default TYPO3_CONF_VARS $configurationManager = new \TYPO3\CMS\Core\Configuration\ConfigurationManager(); $GLOBALS['TYPO3_CONF_VARS'] = $configurationManager->getDefaultConfiguration(); // Avoid failing tests that rely on HTTP_HOST retrieval $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = '.*'; \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->disableCoreCache()->initializeCachingFramework()->initializePackageManagement(\TYPO3\CMS\Core\Package\UnitTestPackageManager::class); if (!\TYPO3\CMS\Core\Core\Bootstrap::usesComposerClassLoading()) { // Dump autoload info if in non composer mode \TYPO3\CMS\Core\Core\ClassLoadingInformation::dumpClassLoadingInformation(); \TYPO3\CMS\Core\Core\ClassLoadingInformation::registerClassLoadingInformation(); } });
/** * Dumps Extension Autoload Information * * @return \TYPO3\CMS\Install\Status\StatusInterface */ protected function dumpAutoload() : \TYPO3\CMS\Install\Status\StatusInterface { if (Bootstrap::usesComposerClassLoading()) { $message = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\NoticeStatus::class); $message->setTitle('Skipped generating additional class loading information in composer mode.'); } else { ClassLoadingInformation::dumpClassLoadingInformation(); $message = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\OkStatus::class); $message->setTitle('Successfully dumped class loading information for extensions.'); } return $message; }
/** * Updates class loading information. * * This command is only needed during development. The extension manager takes care * creating or updating this info properly during extension (de-)activation. * * @return void * @cli */ public function dumpClassLoadingInformationCommand() { if (Bootstrap::usesComposerClassLoading()) { $this->output->outputLine('<error>Class loading information is managed by composer. Use "composer dump-autoload" command to update the information.</error>'); $this->quit(1); } else { ClassLoadingInformation::dumpClassLoadingInformation(); $this->output->outputLine('Class Loading information has been updated.'); } }
/** * Writes class loading information if not yet present * * @return Bootstrap * @internal This is not a public API method, do not use in own extensions * @deprecated since TYPO3 v8, will be removed in TYPO3 v9. Use the Install Tool to dump autoload information. */ public function ensureClassLoadingInformationExists() { if (!self::$usesComposerClassLoading && !ClassLoadingInformation::isClassLoadingInformationAvailable()) { GeneralUtility::logDeprecatedFunction(); ClassLoadingInformation::dumpClassLoadingInformation(); ClassLoadingInformation::registerClassLoadingInformation(); } return $this; }