From: <var...@us...> - 2014-10-07 11:43:58
|
Revision: 9211 http://sourceforge.net/p/phpwiki/code/9211 Author: vargenau Date: 2014-10-07 11:43:50 +0000 (Tue, 07 Oct 2014) Log Message: ----------- We are in PHP >= 5.3 Modified Paths: -------------- trunk/index.php trunk/lib/ErrorManager.php trunk/lib/Request.php trunk/lib/config.php trunk/lib/font/chinese.php trunk/lib/font/japanese.php trunk/lib/main.php trunk/lib/prepend.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2014-10-07 09:21:41 UTC (rev 9210) +++ trunk/index.php 2014-10-07 11:43:50 UTC (rev 9211) @@ -32,8 +32,8 @@ require_once(dirname(__FILE__) . '/lib/IniConfig.php'); IniConfig(dirname(__FILE__) . "/config/config.ini"); -if (version_compare(PHP_VERSION, '5.2', '<')) { - exit(_("Your PHP version is too old. You must have at least PHP 5.2.")); +if (version_compare(PHP_VERSION, '5.3', '<')) { + exit(_("Your PHP version is too old. You must have at least PHP 5.3.")); } //////////////////////////////////////////////////////////////// Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2014-10-07 09:21:41 UTC (rev 9210) +++ trunk/lib/ErrorManager.php 2014-10-07 11:43:50 UTC (rev 9211) @@ -12,9 +12,9 @@ error_reporting(E_ALL & ~E_STRICT); } */ -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_FATAL_ERRORS', E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | ~2048 & (~E_DEPRECATED)); define ('EM_WARNING_ERRORS', - E_WARNING | E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING | ((check_php_version(5, 3)) ? E_DEPRECATED : 0)); + E_WARNING | E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING | E_DEPRECATED); define ('EM_NOTICE_ERRORS', E_NOTICE | E_USER_NOTICE); /* It is recommended to leave assertions on. @@ -22,7 +22,6 @@ Only where absolute speed is necessary you might want to turn them off. */ -//also turn it on if phpwiki_version notes no release if (defined('DEBUG') and DEBUG) assert_options(ASSERT_ACTIVE, 1); else Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-10-07 09:21:41 UTC (rev 9210) +++ trunk/lib/Request.php 2014-10-07 11:43:50 UTC (rev 9211) @@ -609,8 +609,6 @@ $vars[$key] = $val; if (isset($_SESSION)) // php-5.2 $_SESSION[$key] = $val; - if (!check_php_version(5, 3)) - session_register($key); } function delete($key) @@ -622,8 +620,6 @@ unset($vars[$key]); if (isset($_SESSION)) // php-5.2 unset($_SESSION[$key]); - if (!check_php_version(5, 3)) - session_unregister($key); } } Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2014-10-07 09:21:41 UTC (rev 9210) +++ trunk/lib/config.php 2014-10-07 11:43:50 UTC (rev 9211) @@ -30,11 +30,6 @@ @preg_match('/CGI/', $GLOBALS['HTTP_ENV_VARS']['GATEWAY_INTERFACE'])); } -// essential internal stuff -if (!check_php_version(5, 3)) { - set_magic_quotes_runtime(0); -} - /** * Browser Detection Functions * @@ -315,21 +310,6 @@ return preg_match("%^${requri}[^/]*$%", $GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); } -/** - * safe php4 definition for clone. - * php5 copies objects by reference, but we need to clone "deep copy" in some places. - * (BlockParser) - * We need to eval it as workaround for the php5 parser. - * See http://www.acko.net/node/54 - */ -if (!check_php_version(5)) { - eval(' - function clone($object) { - return $object; - } - '); -} - function getUploadFilePath() { Modified: trunk/lib/font/chinese.php =================================================================== --- trunk/lib/font/chinese.php 2014-10-07 09:21:41 UTC (rev 9210) +++ trunk/lib/font/chinese.php 2014-10-07 11:43:50 UTC (rev 9211) @@ -323,10 +323,6 @@ $this->_out('endobj'); } - if (!check_php_version(5,3)) { - $mqr=get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); - } foreach($this->FontFiles as $file=>$info) { //Font file embedding @@ -349,9 +345,6 @@ fclose($f); $this->_out('endobj'); } - if (!check_php_version(5,3)) { - set_magic_quotes_runtime($mqr); - } foreach($this->fonts as $k=>$font) { //Font objects Modified: trunk/lib/font/japanese.php =================================================================== --- trunk/lib/font/japanese.php 2014-10-07 09:21:41 UTC (rev 9210) +++ trunk/lib/font/japanese.php 2014-10-07 11:43:50 UTC (rev 9211) @@ -302,10 +302,6 @@ $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>'); $this->_out('endobj'); } - if (!check_php_version(5,3)) { - $mqr=get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); - } foreach($this->FontFiles as $file=>$info) { //Font file embedding $this->_newobj(); @@ -327,9 +323,6 @@ fclose($f); $this->_out('endobj'); } - if (!check_php_version(5,3)) { - set_magic_quotes_runtime($mqr); - } foreach($this->fonts as $k=>$font) { //Font objects $this->_newobj(); Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2014-10-07 09:21:41 UTC (rev 9210) +++ trunk/lib/main.php 2014-10-07 11:43:50 UTC (rev 9211) @@ -1399,7 +1399,7 @@ // 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 | ((check_php_version(5, 3)) ? E_DEPRECATED : 0)); + $ErrorManager->setPostponedErrorMask(E_NOTICE | E_USER_NOTICE | E_USER_WARNING | E_WARNING | E_STRICT | E_DEPRECATED); else $ErrorManager->setPostponedErrorMask(E_NOTICE | E_USER_NOTICE | E_USER_WARNING | E_WARNING); $request = new WikiRequest(); Modified: trunk/lib/prepend.php =================================================================== --- trunk/lib/prepend.php 2014-10-07 09:21:41 UTC (rev 9210) +++ trunk/lib/prepend.php 2014-10-07 11:43:50 UTC (rev 9211) @@ -7,18 +7,6 @@ // see lib/stdlib.php: phpwiki_version() define('PHPWIKI_VERSION', '1.5.1'); -/** - * Returns true if current php version is at mimimum a.b.c - * Called: check_php_version(5,3) - */ -function check_php_version($a = '0', $b = '0', $c = '0') -{ - static $PHP_VERSION; - if (!isset($PHP_VERSION)) - $PHP_VERSION = substr(str_pad(preg_replace('/\D/', '', PHP_VERSION), 3, '0'), 0, 3); - return ($PHP_VERSION >= ($a . $b . $c)); -} - /** PHP5 deprecated old-style globals if !(bool)ini_get('register_long_arrays'). * See Bug #1180115 * We want to work with those old ones instead of the new superglobals, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |