CakePHP "Fatal error: class debugger" not found "in a file that does not reference the debugger

I get the error message indicated in the header from a file that does not reference the Debugger class. If I manually import Debugger, the error will still be displayed. The line number referenced by the error in the last} end of the class definition in the file. Nothing follows} (not there?>). The file that I am getting the error does not directly refer to Debugger, since I can tell (how, in explicit use Debugger is clearly not).

here is the stack trace:

( ! ) Fatal error: Class 'Debugger' not found in /home/gregg/workspace/Fueled/dapprly/backend/app/Plugin/Facebook/Controller/Component/FapiComponent.php on line 107 Call Stack # Time Memory Function Location 1 0.0003 245664 {main}( ) ../index.php:0 2 0.0168 1657712 Dispatcher->dispatch( ) ../index.php:100 3 0.0237 2753568 Dispatcher->_invoke( ) ../Dispatcher.php:85 4 0.0237 2753768 Controller->constructClasses( ) ../Dispatcher.php:99 5 0.0237 2755712 ComponentCollection->init( ) ../Controller.php:638 6 0.0255 3057112 ComponentCollection->load( ) ../ComponentCollection.php:52 7 0.0255 3057600 class_exists ( ) ../ComponentCollection.php:99 8 0.0255 3057896 App::load( ) ../ComponentCollection.php:0 9 0.0257 3091416 ErrorHandler::handleError( ) ../ComponentCollection.php:551 

and here is the context around line 107:

 class FapiComponent extends Component { // -- snip -- // public function method() { $url = urlencode('http://url'); $param = array( 'access_token' => '##' , 'object' => 'user', 'fields' => 'feed', 'callback_url' => $url); $id = $this->facebook->getAppId(); $subs = $this->facebook->api('/' . $id . '/subscriptions' , 'POST' , $param); } } // <-- line 107 ... nothing after this 
+7
source share
4 answers

I found a mistake.

This class, which I showed, has an initialization method. But it is implemented as

 public function initialize($controller) 

This is an E_STRICT error because it differs from the parent method, leaving a type hint. My setup catches E_STRICT errors. This error causes a Debugger search. I'm not sure why he couldn’t download it, but changing the method to

 public function initialize(Controller $controller) 

fixed the problem that I encountered.

+8
source

This is due to aa PHP error that did not automatically load for compile-time errors (e.g. E_STRICT ).

This was fixed in PHP 5.4.21 and the pull pull request was accepted by CakePHP.

To manually fix this problem and free E_STRICT from CakePHP error handler:

  • Open core.php in your preferred editor (you can find the file by doing something like find . -name core.php ).
  • Find the following line: 'level' => E_ALL & ~E_DEPRECATED,
  • Replace it: 'level' => E_ALL & ~E_DEPRECATED & ~E_STRICT,
+13
source

This happens every time you get an E_STRICT error. The main thing that I had when working with PHP 5.4 is that you must have public, private, and protected function declarations .

0
source

The problem is that php below version 5.4.21 has problems with the autoloader with E_STRICT errors. (E_STRICT - compile time error)

https://bugs.php.net/bug.php?id=65322

I ran into the same problem in some old projects and it is fixed in 2.7.4.

https://github.com/cakephp/cakephp/issues/7376

Thus, the real solution is to upgrade at least 5.4.21 or wait for CakePHP 2.7.4

0
source

All Articles