From: Reini U. <ru...@x-...> - 2002-02-24 18:59:30
|
Jeff Dairiki schrieb: > My point is, that we need to decide what versions of PHP we are going > to support (I thought we already had). Then, if PhpWiki uses functions > which aren't available in a "supported" version of PHP (without providing > appropriate fallbacks or replacements), it is, by definition, a bug > in PhpWiki. > > Of course, it's allowable to change the list of supported PHP versions, > (e.g. PhpWiki 1.2 runs under PHP 3, PhpWiki 1.3 doesn't) but that > shouldn't be done without a fair amount of deliberation. imho we don't need any table of supported functions. the manual tells us all, and if a function is not supported we can dynamically query for that. I would like to see php3 also supported. php-4.0.4pl1 is imho the most used version. array_search is not that hard to implement. below are some php3 workarounds I often use. function my_array_push ($array, $new_element) { if (function_exists('array_push')) { array_push($array,$new_element); } else { $array[] = $new_element; } return $array; } function my_in_array($lookup_value, $lookup_array) { if (function_exists('in_array')) { if (in_array($lookup_value, $lookup_array)) return true; } else { reset($lookup_array); while (list($key, $value) = each($lookup_array)) { if ($value == $lookup_value) return true; } } return false; } //// // returns position of found value in indexed array function my_array_position ($array, $value, $case_insensitive = false) { if (!is_array($array)) return false; for ($i=0; $i < count($array); $i++) { if ($array[$i] === $value) return $i; if (is_string($value)) { if ($case_insensitive) { if (strcasecmp($array[$i], $value) === 0) return $i; } else { if (strcmp($array[$i], $value) === 0) return $i; } } } return false; } BTW: phpwiki fails on safe_mode on. plugins cannot be executed without proper php_admin_value open_basedir settings. > Carsten Klapp said: > > I based this on the most recent function I could think of that is used > > by PhpWiki, I think it's array_search() but I haven't created a list > > of all the functions used. The PHP online docs say this one needs PHP > > 4.0.5 or greater. What's the pl designation in your version, is that a > > beta? > > > > Do you know if there is a table somewhere which lists what version of > > php all the various functions were introduced? (so that one doesn't > > have to look at all the individual function pages). > > > > Carsten > > > > On Saturday, February 23, 2002, at 09:03 pm, Jeff Dairiki wrote: > > > >> Carsten Klapp said: > >>> Update of /cvsroot/phpwiki/phpwiki > >>> In directory usw-pr-cvs1:/tmp/cvs-serv22514 > >>> > >>> Modified Files: > >>> INSTALL > >>> Log Message: > >>> Required PHP version 4.0.5, updated instructions for new RawHTML > >>> plugin > >> > >> Why are we requiring 4.0.5? I use 4.0.4pl1. I'm sure lots of others > >> do too. (It's what RedHat, and others distributions distribute.) > >> (Keep in mind, too, that many people don't have complete control over > >> their web-servers. Up until recently the SourceForge project servers > >> were running 4.0.4pl1, I think...) -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |