Closed sergiors closed 11 years ago
same error occurs with cake 2.4
Found the version as :-1:
////////////////////////////////////////////////////////////////////////////////////////////////////
// +--------------------------------------------------------------------------------------------+ //
// CakePHP Version
//
// Holds a static string representing the current version of CakePHP
//
// CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
// Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
//
// Licensed under The MIT License
// Redistributions of files must retain the above copyright notice.
//
// @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
// @link http://cakephp.org
// @package cake.libs
// @since CakePHP(tm) v 0.2.9
// @license MIT License (http://www.opensource.org/licenses/mit-license.php)
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
2.1.3
Error as :
Notice: Strict (2048): Declaration of UserAuthComponent::initialize() should be compatible with Component::initialize(Controller $controller) in [/home/pradyot1/public_html/gifts/app/Plugin/Usermgmt/Controller/Component/UserAuthComponent.php, line 487]
Trace:
App::load() - CORE/Cake/Core/App.php, line 558
App::load() - CORE/Cake/Core/App.php, line 558
spl_autoload_call - [internal], line ??
class_exists - [internal], line ??
ComponentCollection::load() - CORE/Cake/Controller/ComponentCollection.php, line 99
ComponentCollection::init() - CORE/Cake/Controller/ComponentCollection.php, line 52
Controller::constructClasses() - CORE/Cake/Controller/Controller.php, line 635
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 99
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 85
[main] - APP/webroot/index.php, line 92
Whats the solution . . .
This is a quick fix. You just need to add $controller
as a parameter to the declaration of UserAuthComponent::initialize()
. It's complaining about Component::initialize()
being overridden by a new method that doesn't take the same parameter.
Updated to be compatible with version 2.2.3
http://book.cakephp.org/2.0/en/controllers/components.html#component-api
Errors generated is not compatible Strict (2048): Declaration of ConnectComponent::initialize() should be compatible with Component::initialize(Controller $controller) [APP/Plugin/Facebook/Controller/Component/ConnectComponent.php, line 250] Strict (2048): Declaration of ConnectComponent::startup() should be compatible with Component::startup(Controller $controller) [APP/Plugin/Facebook/Controller/Component/ConnectComponent.php, line 250]