From: <var...@us...> - 2010-05-31 12:01:44
|
Revision: 7448 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7448&view=rev Author: vargenau Date: 2010-05-31 12:01:38 +0000 (Mon, 31 May 2010) Log Message: ----------- Let's assume PHP >= 4.2 Modified Paths: -------------- trunk/lib/Request.php trunk/lib/WikiCallback.php trunk/lib/WikiUserNew.php trunk/lib/difflib.php trunk/lib/plugin/PhpHighlight.php trunk/lib/plugin/WikiAdminChmod.php trunk/lib/plugin/WikiAdminChown.php trunk/lib/plugin/WikiAdminMarkup.php trunk/lib/plugin/WikiAdminRemove.php trunk/lib/plugin/WikiAdminRename.php trunk/lib/plugin/WikiAdminSearchReplace.php trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/Request.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -20,14 +20,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// backward compatibility for PHP < 4.2.0 -if (!function_exists('ob_clean')) { - function ob_clean() { - ob_end_clean(); - ob_start(); - } -} - class Request { function Request() { Modified: trunk/lib/WikiCallback.php =================================================================== --- trunk/lib/WikiCallback.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/WikiCallback.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -119,37 +119,7 @@ function call_array ($args) { $method = &$this->methodName; - //$obj = &$this->object; - - // This should work, except PHP's before 4.0.5 (which includes mine) - // don't have 'call_user_method_array'. - if (check_php_version(4,0,5)) { - return call_user_func_array(array(&$this->object, $method), $args); - } - - // This should work, but doesn't. At least in my PHP, the object seems - // to get passed by value, rather than reference, so any changes to the - // object made by the called method get lost. - /* - switch (count($args)) { - case 0: return call_user_method($method, $obj); - case 1: return call_user_method($method, $obj, $args[0]); - case 2: return call_user_method($method, $obj, $args[0], $args[1]); - case 3: return call_user_method($method, $obj, $args[0], $args[1], $args[2]); - case 4: return call_user_method($method, $obj, $args[0], $args[1], $args[2], $args[3]); - default: trigger_error("Too many arguments to method callback", E_USER_ERROR); - } - */ - - // This seems to work, at least for me (so far): - switch (count($args)) { - case 0: return $this->object->$method(); - case 1: return $this->object->$method($args[0]); - case 2: return $this->object->$method($args[0], $args[1]); - case 3: return $this->object->$method($args[0], $args[1], $args[2]); - case 4: return $this->object->$method($args[0], $args[1], $args[2], $args[3]); - default: trigger_error("Too many arguments to method callback", E_USER_ERROR); - } + return call_user_func_array(array(&$this->object, $method), $args); } function toPearCb() { Modified: trunk/lib/WikiUserNew.php =================================================================== --- trunk/lib/WikiUserNew.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/WikiUserNew.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -1080,7 +1080,7 @@ $dbh = $request->getDbh(); // use phpwiki database } elseif ($dbh->getAuthParam('auth_dsn') == $dbh->getParam('dsn')) { $dbh = $request->getDbh(); // same phpwiki database - } else { // use another external database handle. needs PHP >= 4.1 + } else { // use another external database handle. $local_params = array_merge($GLOBALS['DBParams'],$GLOBALS['DBAuthParams']); $local_params['dsn'] = $local_params['auth_dsn']; $dbh = WikiDB::open($local_params); Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/difflib.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -11,7 +11,6 @@ // FIXME: possibly remove assert()'s for production version? -// PHP3 does not have assert() define('USE_ASSERTS', function_exists('assert')); class _DiffOp { Modified: trunk/lib/plugin/PhpHighlight.php =================================================================== --- trunk/lib/plugin/PhpHighlight.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/PhpHighlight.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -41,8 +41,6 @@ * * Author: Martin Geisler <gim...@gi...>. * - * Added compatibility for PHP < 4.2.0, where the highlight_string() - * function has no second argument. * Added ability to override colors defined in php.ini --Carsten Klapp * * Known Problems: Modified: trunk/lib/plugin/WikiAdminChmod.php =================================================================== --- trunk/lib/plugin/WikiAdminChmod.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminChmod.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -28,8 +28,6 @@ * Usage: <<WikiAdminChmod >> or called via WikiAdminSelect * Author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminChown.php =================================================================== --- trunk/lib/plugin/WikiAdminChown.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminChown.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -25,8 +25,6 @@ * Usage: <<WikiAdminChown s||=* >> or called via WikiAdminSelect * @author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminMarkup.php =================================================================== --- trunk/lib/plugin/WikiAdminMarkup.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminMarkup.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -25,8 +25,6 @@ * Usage: <<WikiAdminMarkup s||=* >> or called via WikiAdminSelect * @author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminRemove.php =================================================================== --- trunk/lib/plugin/WikiAdminRemove.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminRemove.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -28,7 +28,6 @@ * KNOWN ISSUES: * Currently we must be Admin. * Future versions will support PagePermissions. - * requires PHP 4.2 so far. */ // maybe display more attributes with this class... require_once('lib/PageList.php'); Modified: trunk/lib/plugin/WikiAdminRename.php =================================================================== --- trunk/lib/plugin/WikiAdminRename.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminRename.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -25,8 +25,6 @@ * Usage: <<WikiAdminRename >> or called via WikiAdminSelect * @author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 at least. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminSearchReplace.php =================================================================== --- trunk/lib/plugin/WikiAdminSearchReplace.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminSearchReplace.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -25,8 +25,6 @@ * Usage: <<WikiAdminSearchReplace >> or called via WikiAdminSelect * Author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. */ require_once('lib/PageList.php'); require_once('lib/plugin/WikiAdminSelect.php'); Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2010-05-31 11:29:39 UTC (rev 7447) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2010-05-31 12:01:38 UTC (rev 7448) @@ -27,9 +27,6 @@ * Usage: <<WikiAdminSetAcl >> or called via WikiAdminSelect * Author: Reini Urban <ru...@x-...> * - * KNOWN ISSUES: - * Requires PHP 4.2 so far. - * * TODO: UI to add custom group/username. * Currently it's easier to dump a page, fix it manually and * import it, than use Setacl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |