Launch plugin shell in cakephp 2.0

I created a new CakePHP 2.0 application and want to run the plugin shell.

<?php
// app\Plugin\Tmaker\Vendors\Shells\TmakerShell.php
class TmakerShell extends Shell {  
}

However, I do not see it when you start Console/cakefrom the command line.

Please tell me what I missed?

+5
source share
1 answer

According to the latest documentation , the path for the shells has changed to app/Console/Command/.

Move your shell to the following location: app/Plugin/Tmaker/Console/Command/TmakerShell.php(not sure if the directory names of the camel plugin are in CakePHP 2.0, but it looks like they work anyway.)

<?php
class TmakerShell extends Shell {
    public function main() {
        $this->out('It works!');
    }
}

CakePHP 2.0 , app/Config/bootstrap.php, CakePlugin::loadAll(); CakePlugin::load('Tmaker'); .

. Windows :

C:\xampplite\htdocs\cake2\app>..\lib\Cake\Console\cake Tmaker.tmaker

Welcome to CakePHP v2.0.0-beta Console
---------------------------------------------------------------
App : app
Path: C:\xampplite\htdocs\cake2\app\
---------------------------------------------------------------
It works!
+16

All Articles