Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Applying PHP 5.3 compatibility patch from Mark Story. Please update y…
…our config/core.php, webroot/index.php and webroot/test.php accordingly.
  • Loading branch information
nateabele committed Jul 31, 2009
1 parent f1a4352 commit 729d8fd
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 4 deletions.
5 changes: 5 additions & 0 deletions app/config/core.php
Expand Up @@ -184,6 +184,11 @@
*/
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/**
* If you are on PHP 5.3 uncomment this line and correct your server timezone
* to fix the date & time related errors.
*/
//date_default_timezone_set('UTC');
/**
*
* Cache Engine Configuration
Expand Down
7 changes: 7 additions & 0 deletions app/webroot/index.php
Expand Up @@ -52,6 +52,13 @@
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}
/**
* PHP 5.3 raises many notices in bootstrap.
*/
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
error_reporting(E_ALL & ~E_DEPRECATED);

/**
* Editing below this line should NOT be necessary.
Expand Down
9 changes: 8 additions & 1 deletion app/webroot/test.php
Expand Up @@ -24,7 +24,14 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
error_reporting(E_ALL);
/**
* PHP 5.3 raises many notices in bootstrap.
*/
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
error_reporting(E_ALL & ~E_DEPRECATED);

set_time_limit(0);
ini_set('memory_limit','128M');
ini_set('display_errors', 1);
Expand Down
3 changes: 3 additions & 0 deletions cake/bootstrap.php
Expand Up @@ -22,6 +22,9 @@
if (!defined('PHP5')) {
define('PHP5', (PHP_VERSION >= 5));
}
if (!defined('E_DEPRECATED')) {
define('PHP5', (PHP_VERSION >= 5));
}
require CORE_PATH . 'cake' . DS . 'basics.php';
$TIME_START = getMicrotime();
require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
Expand Down
5 changes: 5 additions & 0 deletions cake/console/libs/templates/skel/config/core.php
Expand Up @@ -170,6 +170,11 @@
*/
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/**
* If you are on PHP 5.3 uncomment this line and correct your server timezone
* to fix the date & time related errors.
*/
//date_default_timezone_set('UTC');
/**
*
* Cache Engine Configuration
Expand Down
7 changes: 7 additions & 0 deletions cake/console/libs/templates/skel/webroot/index.php
Expand Up @@ -57,6 +57,13 @@
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}
/**
* PHP 5.3 raises many notices in bootstrap.
*/
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
error_reporting(E_ALL & ~E_DEPRECATED);

/**
* Editing below this line should not be necessary.
Expand Down
9 changes: 8 additions & 1 deletion cake/console/libs/templates/skel/webroot/test.php
Expand Up @@ -24,7 +24,14 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
error_reporting(E_ALL);
/**
* PHP 5.3 raises many notices in bootstrap.
*/
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
error_reporting(E_ALL & ~E_DEPRECATED);

set_time_limit(0);
ini_set('memory_limit','128M');
ini_set('display_errors', 1);
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/configure.php
Expand Up @@ -110,7 +110,7 @@ function write($config, $value = null) {

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

if (function_exists('ini_set')) {
ini_set('display_errors', 1);
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/debugger.php
Expand Up @@ -252,7 +252,7 @@ function log($var, $level = LOG_DEBUG) {
* @access public
*/
function handleError($code, $description, $file = null, $line = null, $context = null) {
if (error_reporting() == 0 || $code === 2048) {
if (error_reporting() == 0 || $code === 2048 || $code === 8192) {
return;
}

Expand Down

0 comments on commit 729d8fd

Please sign in to comment.