Har*_*M V 3 shell cakephp cakephp-2.1
我创建了一个shell脚本,如下所示
<?php
class EmailShell extends AppShell
{
public function main()
{
$this->out('Hello world.');
}
}
Run Code Online (Sandbox Code Playgroud)
当我在命令行中导航到控制台文件夹并键入蛋糕电子邮件时,我收到以下错误.
Error: Shell class EmailShell could not be found.
#0 C:\wamp\www\gitgrow\lib\Cake\Console\ShellDispatcher.php(167): ShellDispatche
r->_getShell('email')
#1 C:\wamp\www\gitgrow\lib\Cake\Console\ShellDispatcher.php(69): ShellDispatcher
->dispatch()
#2 C:\wamp\www\gitgrow\app\Console\cake.php(33): ShellDispatcher::run(Array)
#3 {main}
Run Code Online (Sandbox Code Playgroud)
创建一个在控制台中使用的shell.在本例中,我们将创建一个简单的Hello world shell.在您的应用程序Console/Command目录中创建EmailShell.php.将以下代码放入其中:
class EmailShell extends AppShell {
public function main() {
$this->out('Hello world.');
}
}
Run Code Online (Sandbox Code Playgroud)
然后运行以下命令:
Console/cake email
Run Code Online (Sandbox Code Playgroud)
要么
cake email
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13580 次 |
| 最近记录: |