Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix compatibility with PHP 5.4+
Fixes #2847
  • Loading branch information
markstory committed May 4, 2012
1 parent 784e017 commit a9b5b0c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion cake/bootstrap.php
Expand Up @@ -29,7 +29,10 @@
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
error_reporting(E_ALL & ~E_DEPRECATED);
if (!defined('E_STRICT')) {
define('E_STRICT', 2048);
}
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
/**
* Configuration, directory layout and standard libraries
*/
Expand Down
2 changes: 1 addition & 1 deletion cake/console/cake.php
Expand Up @@ -132,7 +132,7 @@ function ShellDispatcher($args = array()) {
function __initConstants() {
if (function_exists('ini_set')) {
ini_set('display_errors', '1');
ini_set('error_reporting', E_ALL & ~E_DEPRECATED);
ini_set('error_reporting', E_ALL & ~E_DEPRECATED & ~E_STRICT);
ini_set('html_errors', false);
ini_set('implicit_flush', true);
ini_set('max_execution_time', 0);
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/configure.php
Expand Up @@ -284,7 +284,7 @@ function write($config, $value = null) {

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

if (function_exists('ini_set')) {
ini_set('display_errors', 1);
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/configure.test.php
Expand Up @@ -161,7 +161,7 @@ function testSetErrorReportingLevel() {

Configure::write('debug', 2);
$result = ini_get('error_reporting');
$this->assertEqual($result, E_ALL & ~E_DEPRECATED);
$this->assertEqual($result, E_ALL & ~E_DEPRECATED & ~E_STRICT);

$result = ini_get('display_errors');
$this->assertEqual($result, 1);
Expand Down

0 comments on commit a9b5b0c

Please sign in to comment.