2012-09-15 44 views
4

我在cakephp 1.3中開發了一個重負載的項目,現在我的客戶端需要它在最新的CakePHP版本中。將CakePHP1.3移植到2.0

我已經使用基於shell腳本教程遷移它下面的鏈接提供: http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html

版本被替換它得到了遷移在CakePHP的2.0版本,但現在運行的項目我得到一個錯誤

致命錯誤:調用第134行上的D:\ xampp \ htdocs \ arguenet1 \ lib \ Cake \ Controller \ Component \ RequestHandlerComponent.php中的非對象的成員函數parseAccept()

項目主要是使用ajax功能和請求處理程序組件也有用於檢查isAjax請求或不在組件端。

任何人都可以幫助我解決這個錯誤...在此先感謝。

回答

2

__construct()方法的簽名在2.x中發生了變化。見the API docs here。嘗試修改您的AppController :: __結構()像這樣:

public function __construct($request = null, $response = null) { 
    parent::__construct($request, $response); 
    // Your code here. 
} 

感謝this Google Groups thread