Bolt\Application::initialize PHP Méthode

initialize() public méthode

public initialize ( )
    public function initialize()
    {
        // Set up session handling
        $this->initSession();
        // Set up locale and translations.
        $this->initLocale();
        // Initialize Twig and our rendering Provider.
        $this->initRendering();
        // Initialize the Database Providers.
        $this->initDatabase();
        // Initialize the rest of the Providers.
        $this->initProviders();
        // Initialize debugging
        $this->initDebugging();
        // Do a version check
        $this['config.environment']->checkVersion();
        // Initialize enabled extensions before executing handlers.
        $this->initExtensions();
    }

Usage Example

 protected function getApp()
 {
     $sessionMock = $this->getMockBuilder('Symfony\\Component\\HttpFoundation\\Session\\Session')->setMethods(array('clear'))->setConstructorArgs(array(new MockFileSessionStorage()))->getMock();
     $config = new Config\ResourceManager(TEST_ROOT);
     $bolt = new Application(array('resources' => $config));
     $bolt['config']->set('general/database', array('driver' => 'sqlite', 'databasename' => 'test', 'username' => 'test', 'memory' => true));
     $bolt['session'] = $sessionMock;
     $bolt['resources']->setPath('files', __DIR__ . "/files");
     $bolt->initialize();
     return $bolt;
 }
All Usage Examples Of Bolt\Application::initialize