Deprecation warnings when using an “old” core.php
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);
with
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');
with
Configure::write('Routing.admin', 'admin');
With those changes the deprecation warnings should disappear.




Good info, hopefully most of configurables will be sitting in configure object soon. keep tracking those constants was hard enough..
@speedmax: Yes, that’s a good move to remove those constants.