From f385366221c63704eae921a645d202df0718d4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Faugeron?= Date: Fri, 18 Mar 2016 09:03:11 +0000 Subject: [PATCH 1/2] Used autoloaded AppKernel Composer is perfectly capable of autoloading AppKernel (via the `classmap` autoloader), this is the approach used in the [Symfony Standard Edition](https://github.com/symfony/symfony-standard/blob/05bca699ef631d03d4b114b4366ad0c180b55ecb/composer.json#L8). --- Bootstraps/Symfony.php | 4 ---- README.md | 9 +++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Bootstraps/Symfony.php b/Bootstraps/Symfony.php index 21b919d..abaa92b 100644 --- a/Bootstraps/Symfony.php +++ b/Bootstraps/Symfony.php @@ -33,10 +33,6 @@ public function __construct($appenv, $debug) */ public function getApplication() { - if (file_exists('./app/AppKernel.php')) { - require_once './app/AppKernel.php'; - } - $this->includeAutoload(); $app = new SymfonyAppKernel($this->appenv, $this->debug); //which extends \AppKernel diff --git a/README.md b/README.md index 957388c..9961c87 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,12 @@ HttpKernel adapter for use of Symfony and Laravel frameworks with PHP-PM. See ht composer require php-pm/httpkernel-adapter:dev-master +> **Note**: Make sure your `AppKernel` is autoloaded in your `composer.json`: +> +> ``` +> { +> "autoload": { +> "classmap": ["app/AppKernel.php"] +> } +> } +> ``` From 5b1cd8b5dc9be5ff280237740c8a7e82f3c8882c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Faugeron?= Date: Fri, 18 Mar 2016 14:00:34 +0000 Subject: [PATCH 2/2] Added note for Symfony AppKernel autoloading --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9961c87..3ca1e39 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ HttpKernel adapter for use of Symfony and Laravel frameworks with PHP-PM. See ht composer require php-pm/httpkernel-adapter:dev-master -> **Note**: Make sure your `AppKernel` is autoloaded in your `composer.json`: +> **Note**: For Symfony, make sure your `AppKernel` is autoloaded in your +> `composer.json` (shouldn't be an issue for projects created using the Standard +> Edition after November 2015): > > ``` > {