Skip to content

Commit a5c00de

Browse files
nateabelemarkstory
authored andcommitted
Applying PHP 5.3 compatibility patch from. Please update your config/core.php, webroot/index.php and webroot/test.php accordingly.
1 parent b75779e commit a5c00de

File tree

8 files changed

+42
-4
lines changed

8 files changed

+42
-4
lines changed

app/config/core.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@
170170
*/
171171
Configure::write('Acl.classname', 'DbAcl');
172172
Configure::write('Acl.database', 'default');
173+
/**
174+
* If you are on PHP 5.3 uncomment this line and correct your server timezone
175+
* to fix the date & time related errors.
176+
*/
177+
//date_default_timezone_set('UTC');
173178
/**
174179
*
175180
* Cache Engine Configuration

app/webroot/index.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
5858
define('CAKE_CORE_INCLUDE_PATH', ROOT);
5959
}
60+
/**
61+
* PHP 5.3 raises many notices in bootstrap.
62+
*/
63+
if (!defined('E_DEPRECATED')) {
64+
define('E_DEPRECATED', 8192);
65+
}
66+
error_reporting(E_ALL & ~E_DEPRECATED);
6067

6168
/**
6269
* Editing below this line should NOT be necessary.

app/webroot/test.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
* @lastmodified $Date$
2525
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
2626
*/
27-
error_reporting(E_ALL);
27+
/**
28+
* PHP 5.3 raises many notices in bootstrap.
29+
*/
30+
if (!defined('E_DEPRECATED')) {
31+
define('E_DEPRECATED', 8192);
32+
}
33+
error_reporting(E_ALL & ~E_DEPRECATED);
34+
2835
set_time_limit(0);
2936
ini_set('memory_limit','128M');
3037
ini_set('display_errors', 1);

cake/console/libs/templates/skel/config/core.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@
170170
*/
171171
Configure::write('Acl.classname', 'DbAcl');
172172
Configure::write('Acl.database', 'default');
173+
/**
174+
* If you are on PHP 5.3 uncomment this line and correct your server timezone
175+
* to fix the date & time related errors.
176+
*/
177+
//date_default_timezone_set('UTC');
173178
/**
174179
*
175180
* Cache Engine Configuration

cake/console/libs/templates/skel/webroot/index.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
5858
define('CAKE_CORE_INCLUDE_PATH', ROOT);
5959
}
60+
/**
61+
* PHP 5.3 raises many notices in bootstrap.
62+
*/
63+
if (!defined('E_DEPRECATED')) {
64+
define('E_DEPRECATED', 8192);
65+
}
66+
error_reporting(E_ALL & ~E_DEPRECATED);
6067

6168
/**
6269
* Editing below this line should not be necessary.

cake/console/libs/templates/skel/webroot/test.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
* @lastmodified $Date$
2525
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
2626
*/
27-
error_reporting(E_ALL);
27+
/**
28+
* PHP 5.3 raises many notices in bootstrap.
29+
*/
30+
if (!defined('E_DEPRECATED')) {
31+
define('E_DEPRECATED', 8192);
32+
}
33+
error_reporting(E_ALL & ~E_DEPRECATED);
34+
2835
set_time_limit(0);
2936
ini_set('memory_limit','128M');
3037
ini_set('display_errors', 1);

cake/libs/configure.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function write($config, $value = null) {
292292

293293
if (isset($config['debug'])) {
294294
if ($_this->debug) {
295-
error_reporting(E_ALL);
295+
error_reporting(E_ALL & ~E_DEPRECATED);
296296

297297
if (function_exists('ini_set')) {
298298
ini_set('display_errors', 1);

cake/libs/debugger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function log($var, $level = LOG_DEBUG) {
163163
* @access public
164164
*/
165165
function handleError($code, $description, $file = null, $line = null, $context = null) {
166-
if (error_reporting() == 0 || $code === 2048) {
166+
if (error_reporting() == 0 || $code === 2048 || $code === 8192) {
167167
return;
168168
}
169169

0 commit comments

Comments
 (0)