From: <var...@us...> - 2010-06-17 11:35:02
|
Revision: 7541 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7541&view=rev Author: vargenau Date: 2010-06-17 11:34:55 +0000 (Thu, 17 Jun 2010) Log Message: ----------- We assume PHP >= 4.3.10 Modified Paths: -------------- trunk/lib/DbaDatabase.php trunk/lib/HttpClient.php trunk/lib/WikiDB.php trunk/lib/WikiPluginCached.php trunk/lib/XMLRPC/utils.php trunk/lib/XmlElement.php trunk/lib/plugin/SyntaxHighlighter.php trunk/lib/stdlib.php trunk/lib/ziplib.php Modified: trunk/lib/DbaDatabase.php =================================================================== --- trunk/lib/DbaDatabase.php 2010-06-17 10:15:47 UTC (rev 7540) +++ trunk/lib/DbaDatabase.php 2010-06-17 11:34:55 UTC (rev 7541) @@ -50,8 +50,7 @@ $mode = 'r'; } - // lock supported since 4.3.0: - if (check_php_version(4,3,0) and (strlen($mode) == 1)) { + if ((strlen($mode) == 1)) { // PHP 4.3.x Windows lock bug workaround: http://bugs.php.net/bug.php?id=23975 if (isWindows()) { $mode .= "-"; // suppress locking, or Modified: trunk/lib/HttpClient.php =================================================================== --- trunk/lib/HttpClient.php 2010-06-17 10:15:47 UTC (rev 7540) +++ trunk/lib/HttpClient.php 2010-06-17 11:34:55 UTC (rev 7541) @@ -121,8 +121,7 @@ } return false; } - if (check_php_version(4,3,0)) - socket_set_timeout($fp, $this->timeout); + socket_set_timeout($fp, $this->timeout); if ( $this->method == 'POST' and preg_match("/\<methodCall\>/", $this->postdata)) $request = $this->buildRequest("text/xml"); //xmlrpc else if ( $this->method == 'POST' and strstr("\r\nContent-Disposition: form-data; filename=", Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2010-06-17 10:15:47 UTC (rev 7540) +++ trunk/lib/WikiDB.php 2010-06-17 11:34:55 UTC (rev 7541) @@ -275,15 +275,6 @@ */ function getAllPages($include_empty=false, $sortby='', $limit='', $exclude='') { - // HACK: memory_limit=8M will fail on too large pagesets. old php on unix only! - if (USECACHE) { - $mem = ini_get("memory_limit"); - if ($mem and !$limit and !isWindows() and !check_php_version(4,3)) { - $limit = 450; - $GLOBALS['request']->setArg('limit', $limit); - $GLOBALS['request']->setArg('paging', 'auto'); - } - } $result = $this->_backend->get_all_pages($include_empty, $sortby, $limit, $exclude); return new WikiDB_PageIterator($this, $result, @@ -527,12 +518,6 @@ if ($updateWikiLinks) { $lookbehind = "/(?<=[\W:])\Q"; $lookahead = "\E(?=[\W:])/"; - if (!check_php_version(4,3,3)) { - $lookbehind = "/(?<=[\W:])"; - $lookahead = "(?=[\W:])/"; - $from = preg_quote($from, "/"); - $to = preg_quote($to, "/"); - } require_once('lib/plugin/WikiAdminSearchReplace.php'); $links = $oldpage->getBackLinks(); while ($linked_page = $links->next()) { Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2010-06-17 10:15:47 UTC (rev 7540) +++ trunk/lib/WikiPluginCached.php 2010-06-17 11:34:55 UTC (rev 7541) @@ -1119,12 +1119,7 @@ // run "echo $source | $commandLine" and return result function filterThroughCmd($source, $commandLine) { - if (check_php_version(4,3,0)) - return $this->newFilterThroughCmd($source, $commandLine); - elseif (strlen($source) < 255) - return $this->oldFilterThroughCmd($source, $commandLine); - else - return $this->oldFilterThroughCmd_File($source, $commandLine); + return $this->newFilterThroughCmd($source, $commandLine); } /** Modified: trunk/lib/XMLRPC/utils.php =================================================================== --- trunk/lib/XMLRPC/utils.php 2010-06-17 10:15:47 UTC (rev 7540) +++ trunk/lib/XMLRPC/utils.php 2010-06-17 11:34:55 UTC (rev 7541) @@ -211,27 +211,8 @@ $response_buf = ""; if ($host && $uri && $port) { $request_xml = xmlrpc_encode_request($method, $args, $output); - if (isWindows() and !check_php_version(4,3,0)) { - include_once("lib/HttpClient.php"); - $http = new HttpClient($host, $port); - if ($timeout) - $http->timeout = $timeout; - $http->setDebug($debug); - // todo: new auth and/or session cookies - if ($user) - $http->setAuthorization($user, $pass); - if ($cookies) - $http->setCookies($cookies); - if ($http->post($uri, $request_xml)) - $response_buf = $http->content; - else { - $response_buf = $http->errormsg; - return $response_buf; - } - } else { - $response_buf = xu_query_http_post($request_xml, $host, $uri, $port, $debug, - $timeout, $user, $pass, $secure); - } + $response_buf = xu_query_http_post($request_xml, $host, $uri, $port, $debug, + $timeout, $user, $pass, $secure); $retval = find_and_decode_xml($response_buf, $debug); } return $retval; Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2010-06-17 10:15:47 UTC (rev 7540) +++ trunk/lib/XmlElement.php 2010-06-17 11:34:55 UTC (rev 7541) @@ -536,7 +536,7 @@ */ function XmlContent_quote ($string) { if (!$string) return $string; - if (check_php_version(4,1) and isset($GLOBALS['charset']) + if (isset($GLOBALS['charset']) and (!defined('IGNORE_CHARSET_NOT_SUPPORTED_WARNING') or !IGNORE_CHARSET_NOT_SUPPORTED_WARNING)) { return htmlspecialchars($string, ENT_COMPAT, $GLOBALS['charset']); Modified: trunk/lib/plugin/SyntaxHighlighter.php =================================================================== --- trunk/lib/plugin/SyntaxHighlighter.php 2010-06-17 10:15:47 UTC (rev 7540) +++ trunk/lib/plugin/SyntaxHighlighter.php 2010-06-17 11:34:55 UTC (rev 7541) @@ -161,10 +161,7 @@ if (!empty($color)) $args .= " --style $color --inline-css"; if (!empty($style)) $args .= " -F $style"; $commandLine = HIGHLIGHT_EXE . "$args -q -X -f -S $syntax"; - if (check_php_version(4,3,0)) - $code = $this->newFilterThroughCmd($source, $commandLine); - else - $code = $this->oldFilterThroughCmd($source, $commandLine); + $code = $this->newFilterThroughCmd($source, $commandLine); if (empty($code)) return $this->error(fmt("Couldn't start commandline '%s'",$commandLine)); $pre = HTML::pre(HTML::raw($code)); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-06-17 10:15:47 UTC (rev 7540) +++ trunk/lib/stdlib.php 2010-06-17 11:34:55 UTC (rev 7541) @@ -529,8 +529,6 @@ ; elseif (! preg_match("/\.$force_img$/i", $url)) ; // only valid image extensions or scripts assumed to generate images - elseif (!check_php_version(4,3) and preg_match("/^http.+\.png$/i",$url)) - ; // it's safe to assume that this will fail. elseif (preg_match("/^http/",$url)) { // external url $size = @getimagesize($url); } else { // local file @@ -1050,11 +1048,9 @@ global $WikiNameRegexp, $request; $bang_esc[] = "(?:" . ALLOWED_PROTOCOLS . "):[^\s<>\[\]\"'()]*[^\s<>\[\]\"'(),.?]"; // before 4.3.9 pcre had a memory release bug, which might hit us here. so be safe. - if (check_php_version(4,3,9)) { - $map = getInterwikiMap(); - if ($map_regex = $map->getRegexp()) + $map = getInterwikiMap(); + if ($map_regex = $map->getRegexp()) $bang_esc[] = $map_regex . ":[^\\s.,;?()]+"; // FIXME: is this really needed? - } $bang_esc[] = $WikiNameRegexp; $orig[] = '/!((?:' . join(')|(', $bang_esc) . '))/'; $repl[] = '~\\1'; @@ -1751,7 +1747,7 @@ function isa ($object, $class) { //if (check_php_version(5)) // return $object instanceof $class; - if (check_php_version(4,2) and !check_php_version(5)) + if (!check_php_version(5)) return is_a($object, $class); $lclass = check_php_version(5) ? $class : strtolower($class); Modified: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2010-06-17 10:15:47 UTC (rev 7540) +++ trunk/lib/ziplib.php 2010-06-17 11:34:55 UTC (rev 7541) @@ -268,10 +268,7 @@ function addSrcFile ($target, $src, $attrib = false) { if (empty($attrib['mtime'])) $attrib = array('mtime' => filemtime($src), 'is_ascii' => 0); - if (check_php_version(4,3)) - $this->addRegularFile($target, file_get_contents($src), $attrib); - else - $this->addRegularFile($target, join('', file($src)), $attrib); + $this->addRegularFile($target, file_get_contents($src), $attrib); } function addRegularFile ($filename, $content, $attrib = false) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |