From 9bcf570509e14f9a84fe27051d84a50ebfc9b37f Mon Sep 17 00:00:00 2001 From: vargenau Date: Fri, 22 Jan 2010 14:06:31 +0000 Subject: [PATCH] Process log messages of type 'E_DEPRECATED' as warnings (for PHP 5.3 migration) git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@7286 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/ErrorManager.php | 4 ++-- lib/main.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ErrorManager.php b/lib/ErrorManager.php index 125bfda08..87d0aec10 100644 --- a/lib/ErrorManager.php +++ b/lib/ErrorManager.php @@ -12,9 +12,9 @@ if (defined('E_STRICT') error_reporting(E_ALL & ~E_STRICT); } */ -define ('EM_FATAL_ERRORS', E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | ~2048); +define ('EM_FATAL_ERRORS', E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | ~2048 & ((check_php_version(5,3)) ? ~E_DEPRECATED : ~0)); define ('EM_WARNING_ERRORS', - E_WARNING | E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING); + E_WARNING | E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING | ((check_php_version(5,3)) ? E_DEPRECATED : 0)); define ('EM_NOTICE_ERRORS', E_NOTICE | E_USER_NOTICE); /* It is recommended to leave assertions on. diff --git a/lib/main.php b/lib/main.php index 9fc661115..36acec06b 100644 --- a/lib/main.php +++ b/lib/main.php @@ -2,6 +2,8 @@ rcs_id('$Id$'); /* * Copyright 1999-2008 $ThePhpWikiProgrammingTeam + * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright (C) 2009 Roger Guignard, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -1330,7 +1332,7 @@ function main () { // Postpone warnings global $ErrorManager; if (defined('E_STRICT')) // and (E_ALL & E_STRICT)) // strict php5? - $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE|E_USER_WARNING|E_WARNING|E_STRICT); + $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE|E_USER_WARNING|E_WARNING|E_STRICT|((check_php_version(5,3)) ? E_DEPRECATED : 0)); else $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE|E_USER_WARNING|E_WARNING); $request = new WikiRequest(); -- 2.45.0