scanAndRegister() 공개 정적인 메소드

Scan the module directories for config/autoload.php files and then register the autoloader on the SPL stack
public static scanAndRegister ( )
예제 #1
0
 /**
  * Initializes the framework.
  */
 private function initializeFramework()
 {
     // Set the error_reporting level
     error_reporting($this->errorLevel);
     $this->includeHelpers();
     // TODO: use Monolog to log errors
     $this->iniSet('error_log', $this->rootDir . '/system/logs/error.log');
     $this->includeBasicClasses();
     // Set the container
     System::setContainer($this->container);
     // Preload the configuration (see #5872)
     $this->config->preload();
     // Register the class loader
     ClassLoader::scanAndRegister();
     $this->initializeLegacySessionAccess();
     $this->setDefaultLanguage();
     // Fully load the configuration
     $this->config->initialize();
     $this->validateInstallation();
     Input::initialize();
     $this->setTimezone();
     // Set the mbstring encoding
     if (USE_MBSTRING && function_exists('mb_regex_encoding')) {
         mb_regex_encoding($this->config->get('characterSet'));
     }
     $this->triggerInitializeSystemHook();
     $this->handleRequestToken();
 }
예제 #2
0
 /**
  * Initializes the framework.
  */
 private function initializeFramework()
 {
     // Set the error_reporting level
     error_reporting($this->errorLevel);
     $this->includeHelpers();
     $this->includeBasicClasses();
     // Set the container
     System::setContainer($this->container);
     /** @var Config $config */
     $config = $this->getAdapter('Contao\\Config');
     // Preload the configuration (see #5872)
     $config->preload();
     // Register the class loader
     ClassLoader::scanAndRegister();
     $this->initializeLegacySessionAccess();
     $this->setDefaultLanguage();
     // Fully load the configuration
     $config->getInstance();
     $this->validateInstallation();
     Input::initialize();
     $this->setTimezone();
     $this->triggerInitializeSystemHook();
     $this->handleRequestToken();
 }
예제 #3
0
 /**
  * Boots the helper system.
  */
 private function bootHelperSystem()
 {
     $contaoDir = $this->getRootDir() . '/../vendor/contao/core-bundle';
     require_once $contaoDir . '/src/Resources/contao/config/constants.php';
     require_once $contaoDir . '/src/Resources/contao/helper/functions.php';
     // Register the class loader
     $libraryLoader = new LibraryLoader($this->getRootDir());
     $libraryLoader->register();
     Config::preload();
     // Create the container
     $this->container = ContainerFactory::create($this);
     System::setContainer($this->container);
     ClassLoader::scanAndRegister();
 }
예제 #4
0
 * Copyright (c) 2005-2015 Leo Feyer
 *
 * @license LGPL-3.0+
 */
use Contao\ClassLoader;
use Contao\Config;
use Contao\InstallationBundle\ClassLoader\LibraryLoader;
use Contao\InstallationBundle\Controller\InstallationController;
use Contao\InstallationBundle\DependencyInjection\ContainerFactory;
use Contao\System;
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED);
$loader = (require_once __DIR__ . '/../vendor/autoload.php');
require_once __DIR__ . '/../app/AppKernel.php';
require_once __DIR__ . '/../vendor/contao/core-bundle/src/Resources/contao/config/constants.php';
require_once __DIR__ . '/../vendor/contao/core-bundle/src/Resources/contao/helper/functions.php';
$kernel = new AppKernel('prod', false);
// Un-normalize the path (see #208)
$rootDir = strtr($kernel->getRootDir(), '/', DIRECTORY_SEPARATOR);
// Register the class loader
$libraryLoader = new LibraryLoader($rootDir);
$libraryLoader->register();
Config::preload();
// Create the container
$container = ContainerFactory::create($rootDir);
System::setContainer($container);
ClassLoader::scanAndRegister();
// Run the controller
$controller = new InstallationController();
$controller->setContainer($container);
$response = $controller->indexAction();
$response->send();