Permalink
Browse files

Fix compatibility with PHP 5.4+

Fixes #2847
  • Loading branch information...
1 parent 784e017 commit a9b5b0ce22e34c82f09b656d12f47515c05ec158 @markstory markstory committed May 4, 2012
Showing with 7 additions and 4 deletions.
  1. +4 −1 cake/bootstrap.php
  2. +1 −1 cake/console/cake.php
  3. +1 −1 cake/libs/configure.php
  4. +1 −1 cake/tests/cases/libs/configure.test.php
View
@@ -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
*/
View
@@ -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);
View
@@ -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);
@@ -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);

0 comments on commit a9b5b0c

Please sign in to comment.