我的 CakePHP 版本:2.8.4 PHP:7.1.12 (FastCGI)
我刚刚注意到错误日志充满了这个:
2018-01-07 09:05:33 Warning: Warning (2): Narrowing occurred during type inference. Please file a bug report on bugs.php.net in [/var/www/******/httpdocs/lib/Cake/Core/App.php, line 547]
Trace:
include - CORE/Cake/Core/App.php, line 547
App::load() - CORE/Cake/Core/App.php, line 547
spl_autoload_call - [internal], line ??
TranslateBehavior::_getLocale() - CORE/Cake/Model/Behavior/TranslateBehavior.php, line 534
TranslateBehavior::beforeFind() - CORE/Cake/Model/Behavior/TranslateBehavior.php, line 104
ObjectCollection::trigger() - CORE/Cake/Utility/ObjectCollection.php, line 128
CakeEventManager::dispatch() - CORE/Cake/Event/CakeEventManager.php, line 243
Model::buildQuery() - CORE/Cake/Model/Model.php, line 3084
Model::find() - CORE/Cake/Model/Model.php, line 2998
DboSource::query() - CORE/Cake/Model/Datasource/DboSource.php, line 595
Model::__call() - CORE/Cake/Model/Model.php, line 827
GalleryPicturesController::getPicture() - APP/Controller/GalleryPicturesController.php, line 35
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 491
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 193
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 167
[main] - APP/webroot/index.php, line 110
有很多这样的错误。
不仅仅是关于 GalleryPicturesController.php,而是总是指“Cake/Core/App.php,第 547 行”。
错误的原因可能是什么?
更新
解决方案:
class AppModel extends Model
{
public $locale = 'hun';//I just added it
但现在:
2018-01-07 11:27:20 Warning: Warning (2): Narrowing occurred during type inference. Please file a bug report on bugs.php.net in [/var/www/******/httpdocs/lib/Cake/Core/App.php, line 547]
Trace:
include - CORE/Cake/Core/App.php, line 547
App::load() - CORE/Cake/Core/App.php, line 547
spl_autoload_call - [internal], line ??
__ - CORE/Cake/basics.php, line 587
include - APP/View/GalleryPictures/open.ctp, line 64
View::_evaluate() - CORE/Cake/View/View.php, line 971
View::_render() - CORE/Cake/View/View.php, line 933
View::render() - CORE/Cake/View/View.php, line 473
Controller::render() - CORE/Cake/Controller/Controller.php, line 963
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 200
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 167
[main] - APP/webroot/index.php, line 110
在:GalleryPictures/open.ctp,第 64 行:
<th><?php echo(__('Feltöltő')); ?></th>