From 7dae9e24dac90ba5c55db17e96cabf9d1a80c1d0 Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Thu, 20 Jul 2017 22:21:01 +0200 Subject: [PATCH] improved loading of composer autoload --- app/Config/bootstrap.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Config/bootstrap.php b/app/Config/bootstrap.php index b4fb5290a..67cdf2057 100644 --- a/app/Config/bootstrap.php +++ b/app/Config/bootstrap.php @@ -22,6 +22,17 @@ * @license https://opensource.org/licenses/mit-license.php MIT License */ +/** + * Load Composer autoload. + * + * Remove and re-prepend CakePHP's autoloader as Composer thinks it is the most important. + * @see http://goo.gl/kKVJO7 + * @see http://book.cakephp.org/2.0/en/installation/advanced-installation.html#installing-cakephp-with-composer + */ +require ROOT . DS . 'vendors/autoload.php'; +spl_autoload_unregister(array('App', 'load')); +spl_autoload_register(array('App', 'load'), true, true); + // Setup a 'default' cache configuration for use in the application. Cache::config('default', array('engine' => 'File'));