From ab358a4458b052fc80a3e99a93b125c1ef133a38 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Tue, 13 Oct 2015 18:48:59 +0200 Subject: [PATCH] #868 Load the AppKernel class using Composer's autoloader It is possible to register single files to load every time in Composer. Using Composer to load the AppKernel means we don't have to manually include it in all the entry points of the application. --- app/AppCache.php | 2 -- app/console | 1 - composer.json | 3 ++- web/app.php | 1 - web/app_dev.php | 2 -- 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/AppCache.php b/app/AppCache.php index ddb51db058..639ec2cd7e 100644 --- a/app/AppCache.php +++ b/app/AppCache.php @@ -1,7 +1,5 @@ getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev'); diff --git a/composer.json b/composer.json index a6a949da36..7a8fbf29b3 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,8 @@ "type": "project", "description": "The \"Symfony Standard Edition\" distribution", "autoload": { - "psr-4": { "": "src/" } + "psr-4": { "": "src/" }, + "files": [ "app/AppKernel.php" ] }, "require": { "php": ">=5.3.9", diff --git a/web/app.php b/web/app.php index 46e6b2f58b..a88f0b5a04 100644 --- a/web/app.php +++ b/web/app.php @@ -18,7 +18,6 @@ $apcLoader->register(true); */ -require_once __DIR__.'/../app/AppKernel.php'; //require_once __DIR__.'/../app/AppCache.php'; $kernel = new AppKernel('prod', false); diff --git a/web/app_dev.php b/web/app_dev.php index 965bda8357..635bf7ac7b 100644 --- a/web/app_dev.php +++ b/web/app_dev.php @@ -24,8 +24,6 @@ $loader = require __DIR__.'/../app/autoload.php'; Debug::enable(); -require_once __DIR__.'/../app/AppKernel.php'; - $kernel = new AppKernel('dev', true); $kernel->loadClassCache(); $request = Request::createFromGlobals();