Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit a100b8d

Browse files
committed
feature #869 Autoload the AppKernel using Composer (mnapoli)
This PR was merged into the 2.8 branch. Discussion ---------- Autoload the AppKernel using Composer Fixes #868 Using Composer to load the AppKernel means we don't have to manually include it in all the entry points of the application. Commits ------- ab358a4 #868 Load the AppKernel class using Composer's autoloader
2 parents 5ee7e77 + ab358a4 commit a100b8d

File tree

5 files changed

+2
-7
lines changed

5 files changed

+2
-7
lines changed

app/AppCache.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
require_once __DIR__.'/AppKernel.php';
4-
53
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
64

75
class AppCache extends HttpCache

app/console

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ set_time_limit(0);
1515
* @var Composer\Autoload\ClassLoader $loader
1616
*/
1717
$loader = require __DIR__.'/../app/autoload.php';
18-
require_once __DIR__.'/AppKernel.php';
1918

2019
$input = new ArgvInput();
2120
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"type": "project",
55
"description": "The \"Symfony Standard Edition\" distribution",
66
"autoload": {
7-
"psr-4": { "": "src/" }
7+
"psr-4": { "": "src/" },
8+
"files": [ "app/AppKernel.php" ]
89
},
910
"require": {
1011
"php": ">=5.3.9",

web/app.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
$apcLoader->register(true);
1919
*/
2020

21-
require_once __DIR__.'/../app/AppKernel.php';
2221
//require_once __DIR__.'/../app/AppCache.php';
2322

2423
$kernel = new AppKernel('prod', false);

web/app_dev.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
$loader = require __DIR__.'/../app/autoload.php';
2525
Debug::enable();
2626

27-
require_once __DIR__.'/../app/AppKernel.php';
28-
2927
$kernel = new AppKernel('dev', true);
3028
$kernel->loadClassCache();
3129
$request = Request::createFromGlobals();

0 commit comments

Comments
 (0)