$ cd /path/to/your/website
$ rm -Rf ./lib
Put it in the top level, NOT in app/!
{
"minimum-stability": "dev",
"config": {
"vendor-dir": "vendors"
},
"repositories" : [
{
"type": "package",
"package": {
"name" : "cakephp/cakephp",
"version" : "2.4.1",
"source" : {
"type" : "git",
"url" : "git://github.com/cakephp/cakephp.git",
"reference" : "2.4.1"
},
"bin" : ["lib/Cake/Console/cake"]
}
}
],
"extra": {
"installer-paths": {
"app/Plugin/DebugKit": ["cakephp/debug_kit"]
}
},
"require" : {
"php": ">=5.3",
"cakephp/cakephp" : "2.4.*",
"cakephp/debug_kit": "2.2.*"
}
}
$ composer update
$ vendors/bin/cake bake project $(pwd)/app
Replace this...
<?php
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
...with this
<?php
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'vendors' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib');
Replace this...
<?php
$root = dirname(dirname(dirname(__FILE__)));
...with this
<?php
$root = dirname(dirname(dirname(__FILE__))) . $ds . 'vendors' . $ds . 'cakephp' . $ds . 'cakephp';
<?php
require dirname(dirname(__DIR__)) . '/vendors/autoload.php';
Hi min fix is: DS
$root = dirname(dirname(dirname(__FILE__))) . DS . 'vendors' . DS . 'cakephp' . DS . 'cakephp';
And End use
composer dumpautoload -o
Ahh Add attach + info for composer and CakePHP 2.x :
https://onoya.dev/install-cakephp-2-using-composer/
Using Namespaced:
https://blog.garr.co.uk/php/2015/10/01/using-namespaced-classes-in-cakephp2.html