Deprecation warnings when using an “old” core.php

Published on and tagged with cakephp  warning

Today I wanted to work on a project I baked some time ago. As I requested the respective url in my browser I got two warnings:

Warning: Deprecated: Use Configure::write('debug', 2); in 
/home/dho/projects/cake_1.2.x.x/cake/libs/configure.php on line 559
Warning (512): Deprecated: Use Router::parseExtensions(); [CORE/cake/libs/configure.php, line 567]

As I didn’t understood why those warnings appeared and how to make them disappear — maybe I am simply too stupid ;-) — I had a look at the source of the configure.php file. And there I saw it checks whether some constants from core.php are defined, and if that is the case a warning is triggered.

So I had to replace in app/config/core.php

define('DEBUG', 2);


Configure::write('debug', 2);

Plus I had to remove the following entry:

define('WEBSERVICES', 'off');

You could also replace this entry with

Configure::write('Routing.webservices', 'off');

But this is deprecated, too, even though no warning is displayed.

And if you have defined the CAKE_ADMIN constant (which is by default commented out), you have to replace

define('CAKE_ADMIN', 'admin');


Configure::write('Routing.admin', 'admin');

With those changes the deprecation warnings should disappear.

2 comments baked

© daniel hofstetter. Licensed under a Creative Commons License