Пример #1
0
 /**
  * Return 'this' as singleton
  *
  * @return \TYPO3\CMS\Core\Core\Bootstrap
  * @internal This is not a public API method, do not use in own extensions
  */
 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new \TYPO3\CMS\Core\Core\Bootstrap();
     }
     return self::$instance;
 }
Пример #2
0
 /**
  * Sets the class loader to the bootstrap
  *
  * @param \Composer\Autoload\ClassLoader $classLoader an instance of the class loader
  * @return Bootstrap
  * @internal This is not a public API method, do not use in own extensions
  */
 public function initializeClassLoader($classLoader)
 {
     $this->setEarlyInstance(\Composer\Autoload\ClassLoader::class, $classLoader);
     if (defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE) {
         self::$usesComposerClassLoading = true;
     }
     return $this;
 }
Пример #3
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)) {
         require_once __DIR__ . '/../Exception.php';
         require_once __DIR__ . '/ApplicationContext.php';
         $applicationContext = getenv('TYPO3_CONTEXT') ?: (getenv('REDIRECT_TYPO3_CONTEXT') ?: 'Production');
         self::$instance = new static($applicationContext);
         // Establish an alias for Flow/Package interoperability
         class_alias(get_class(static::$instance), 'TYPO3\\Flow\\Core\\Bootstrap');
     }
     return static::$instance;
 }