2013-09-30 36 views
0

下面是我的殼類級 '應用程序' 沒有找到,同時運行的CakePHP殼

FriendShell.php

require_once 'AppShell.php'; 

class FriendShell extends AppShell 
{ 
     //code 
} 

AppShell.php

App::uses('Shell', 'Console'); 

class AppShell extends Shell { 
    public function perform() { 
     $this->initialize(); 
     $this->{array_shift($this->args)}(); 
    } 
} 

參考發行上

https://github.com/kamisama/Cake-Resque/issues/25

我刪除

App::uses('AppShell', 'Console/Command'); 

現在使用

require_once 'AppShell.php'; 
在FriendShell.php

但問題仍然存在

因爲AppShell.php使用

App::uses('Shell', 'Console'); 

這就是爲什麼我得到錯誤當試圖運行該shell時未找到類'App'

任何幫助表示讚賞

謝謝

+0

我不認爲這就是你得到這個錯誤的原因。 AppShell是一個供應商軟件包。試試這個'App :: uses('AppShell','Vendor/Shells');'。如果你錯誤地啓動了shell,'App'也是不確定的。 – cgTag

+0

@MathewFoscarini謝謝你的迴應,我試過你的建議,但仍然給出同樣的錯誤。 –

+0

@ MathewFoscarini,讓我清除場景,目前我在應用程序目錄'php控制檯/命令/ FriendShell.php'並執行此命令。是否有任何問題? –

回答

1

Console/cake 

工作是CakeResque插件和FriendShell.php是一個作業類,因此整個命令看現在這個樣子

Console/cake CakeResque.CakeResque enqueue default Friend "swapnil" 
+0

而且還應該注意,'require_once'AppShell.php'; '是無稽之談。以前有什麼是正確的(App :: uses()語句)。 – mark

+0

@ mark,現在確定了,但是我確實是因爲同樣的問題鏈接。感謝您的回覆 –

+0

這個命令的窗口是什麼? – thunderbird

相關問題