2013-09-23 73 views
0

當我運行cake bake controller all,我收到以下錯誤:如何使用「蛋糕烘烤控制器全部」?

$ ./app/Console/cake bake controller all 

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /Applications/MAMP/htdocs/cakephp/lib/Cake/Cache/CacheEngine.php on line 60 

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /Applications/MAMP/htdocs/cakephp/lib/Cake/Cache/CacheEngine.php on line 60 

Welcome to CakePHP v2.4.1 Console 
--------------------------------------------------------------- 
App : app 
Path: /Applications/MAMP/htdocs/cakephp/app/ 
--------------------------------------------------------------- 

You can download PHPUnit from http://phpunit.de 

Baking controller class for Accounts... 

Creating file /Applications/MAMP/htdocs/cakephp/app/Controller/AccountsController.php 
Wrote `/Applications/MAMP/htdocs/cakephp/app/Controller/AccountsController.php` 
Bake is detecting possible fixtures... 
Warning Error: Argument 1 passed to Component::__construct() must be an instance of ComponentCollection, array given in [/Applications/MAMP/htdocs/cakephp/lib/Cake/Controller/Component.php, line 79] 


Fatal error: Call to undefined method Component::getAssociated() in /Applications/MAMP/htdocs/cakephp/lib/Cake/Console/Command/Task/TestTask.php on line 394 
Fatal Error Error: Call to undefined method Component::getAssociated() in [/Applications/MAMP/htdocs/cakephp/lib/Cake/Console/Command/Task/TestTask.php, line 394] 

但是,如果我單獨運行它,它的工作原理:

--------------------------------------------------------------- 
Baking AccountsController 
--------------------------------------------------------------- 
Would you like to build your controller interactively? 
Warning: Choosing no will overwrite the AccountsController. (y/n) 
[y] > y 
Would you like to use dynamic scaffolding? (y/n) 
[n] > y 

--------------------------------------------------------------- 
The following controller will be created: 
--------------------------------------------------------------- 
Controller Name: 
    Accounts 
public $scaffold; 
--------------------------------------------------------------- 
Look okay? (y/n) 
[y] > y 

Baking controller class for Accounts... 

File `/Applications/MAMP/htdocs/cakephp/app/Controller/AccountsController.php` exists 
Do you want to overwrite? (y/n/q) 
[n] > y 
Wrote `/Applications/MAMP/htdocs/cakephp/app/Controller/AccountsController.php` 
PHPUnit is not installed. Do you want to bake unit test files anyway? (y/n) 
[y] > n 

回答

-1

PHP現在更加依賴於你的設置相關的時區爲您的服務器。

在php.ini中找到該指令

date.timezone = 

給它的值是相關的服務器運行

其中如

date.timezone = "Europe/London" 
date.timezone = "Asia/Manila" 

看這個manual page手冊來找到一個有效的時區。

+0

我解決了這個問題,但它仍然無法正常工作。 – NobleUplift

相關問題