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

Autoload the AppKernel using Composer #869

Merged
merged 1 commit into from
Oct 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/AppCache.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

require_once __DIR__.'/AppKernel.php';

use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;

class AppCache extends HttpCache
Expand Down
1 change: 0 additions & 1 deletion app/console
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ set_time_limit(0);
* @var Composer\Autoload\ClassLoader $loader
*/
$loader = require __DIR__.'/../app/autoload.php';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it can be simplified too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not part of this pull request, additionally I believe the variable is kept so that you can uncomment the code below: https://github.com/symfony/symfony-standard/blob/2.8/web/app.php#L11-L19

require_once __DIR__.'/AppKernel.php';

$input = new ArgvInput();
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion web/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
$apcLoader->register(true);
*/

require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/AppCache.php';

$kernel = new AppKernel('prod', false);
Expand Down
2 changes: 0 additions & 2 deletions web/app_dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
$loader = require __DIR__.'/../app/autoload.php';
Debug::enable();

require_once __DIR__.'/../app/AppKernel.php';

$kernel = new AppKernel('dev', true);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aitboudad it’s there

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

$kernel->loadClassCache();
$request = Request::createFromGlobals();
Expand Down