Windows version
mkdir C:\path\to\your\project
cd C:\path\to\your\project
echo {} > composer.json
composer config name me/project
composer config type project
composer config vendor-dir vendors
composer config extra.installer-types ["cakephp-plugin"]
composer config extra.installer-paths.app/Plugin/{$name} ["type:cakephp-plugin"]
The created composer.json look as this:
{
"name": "presst/presst",
"type": "project",
"config": {
"vendor-dir": "vendors"
},
"extra": {
"installer-types": "[cakephp-plugin]",
"installer-paths": {
"app/Plugin/{$name}": "[type:cakephp-plugin]"
}
}
}
But extra.installer-types and extra.installer-paths are array istead of string type.
php -a
$composer = json_decode(file_get_contents('composer.json'), true);
$composer['extra']['installer-types'] = ['cakephp-plugin'];
$composer['extra']['installer-paths']['app/Plugin/{$name}'] = ['type:cakephp-plugin'];
file_put_contents('composer.json', json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
exit
The fixed composer.json look as this:
{
"name": "presst/presst",
"type": "project",
"config": {
"vendor-dir": "vendors"
},
"extra": {
"installer-types": [
"cakephp-plugin"
],
"installer-paths": {
"app/Plugin/{$name}": [
"type:cakephp-plugin"
]
}
}
}
composer require oomphinc/composer-installers-extender:* cakephp/cakephp:2.* cakephp/debug_kit:2.*
php vendors\cakephp\cakephp\lib\Cake\Console\cake.php -working . bake project .\app
Replace this...
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib');
...with this
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'vendors' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib');
Replace this...
$install = $root . PATH_SEPARATOR . 'C:' . DS . 'path' . DS . 'to' . DS . 'your' . DS . 'project' . DS . 'vendors' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
...with this
$install = $root . DS . 'vendors' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
-
You need to enable the plugin in your
app/Config/bootstrap.php
file. If you are already usingCakePlugin::loadAll();
, then the following is not necessary.:CakePlugin::load('DebugKit');
-
Include the toolbar component in your
app/Controller/AppController.php
:class AppController extends Controller { public $components = array('DebugKit.Toolbar'); }
-
Set
Configure::write('debug', 1);
inapp/Config/core.php
. -
In
app/View/Layouts/default.ctp
replace this...<?php echo $this->element('sql_dump'); ?>
...with this
<?php if (Configure::read('debug') and !class_exists('DebugPanel')) { echo $this->Html->css('cake.debug', ['inline' => true]); echo $this->Html->div('container-sql', $this->element('sql_dump')); } ?>
App::import('Vendor', ['file' => 'autoload']);