/** * Builds a boot sequence with the minimum modules necessary for both, compiletime * and runtime. * * @param string $identifier * @return \TYPO3\Flow\Core\Booting\Sequence * @api */ public function buildEssentialsSequence($identifier) { $sequence = new Sequence($identifier); if ($this->context->isProduction()) { $lockManager = new \TYPO3\Flow\Core\LockManager(); $lockManager->exitIfSiteLocked(); if ($identifier === 'compiletime') { $lockManager->lockSiteOrExit(); // make sure the site is unlocked even if the script ends unexpectedly due to an error/exception register_shutdown_function(array($lockManager, 'unlockSite')); } $this->setEarlyInstance(\TYPO3\Flow\Core\LockManager::class, $lockManager); } $sequence->addStep(new Step('typo3.flow:annotationregistry', array(\TYPO3\Flow\Core\Booting\Scripts::class, 'registerClassLoaderInAnnotationRegistry'))); $sequence->addStep(new Step('typo3.flow:configuration', array(\TYPO3\Flow\Core\Booting\Scripts::class, 'initializeConfiguration')), 'typo3.flow:annotationregistry'); $sequence->addStep(new Step('typo3.flow:systemlogger', array(\TYPO3\Flow\Core\Booting\Scripts::class, 'initializeSystemLogger')), 'typo3.flow:configuration'); $sequence->addStep(new Step('typo3.flow:errorhandling', array(\TYPO3\Flow\Core\Booting\Scripts::class, 'initializeErrorHandling')), 'typo3.flow:systemlogger'); $sequence->addStep(new Step('typo3.flow:cachemanagement', array(\TYPO3\Flow\Core\Booting\Scripts::class, 'initializeCacheManagement')), 'typo3.flow:systemlogger'); return $sequence; }
/** * Initializes the Lock Manager * * @param Bootstrap $bootstrap * @return void */ public static function initializeLockManager(Bootstrap $bootstrap) { $systemLogger = $bootstrap->getEarlyInstance('TYPO3\\Flow\\Log\\SystemLoggerInterface'); $lockManager = new \TYPO3\Flow\Core\LockManager(); $lockManager->injectEnvironment($bootstrap->getEarlyInstance('TYPO3\\Flow\\Utility\\Environment')); $lockManager->injectSystemLogger($systemLogger); $lockManager->initializeObject(); $lockManager->exitIfSiteLocked(); $bootstrap->setEarlyInstance('TYPO3\\Flow\\Core\\LockManager', $lockManager); }