Re: Pear 1.3 Dependencies question
| From: | Alexander Schilling | Date: | Fri, 27 Feb 2004 13:16:48 +0000 |
| Subject: | Re: Pear 1.3 Dependencies question | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-10994@lists.php.net to get a copy of this message | ||
Stefan Neufeind wrote:
On 27 Feb 2004 at 9:14, Joost De Cock wrote: Upgrading php is no option for you? A lot of packages already need things like is_a and similar which are just available from 4.2 onward. Also, php 4.1.2 is quite old already :-)) If you might do additional things apart from using IMP or something I'd strongly suggest you upgrade to a more recent version of php (and then a more recent version of PEAR as well).You may use a replacement for the is_a() function: ------------------------------------------------------------------ if (!function_exists('is_a')) { /** * Check if it is object of the given class. * * This function is an emulation of the PHP 4.2 behaviour for Version 4.1. * * Returns TRUE if the object is of this class or has this class as one of * its parents. * * @access public
* @param object $object object which should be checked * @param string $classname class for which to check * @return bool true if it is of this class or parent class*/ function is_a($object, $classname) {
return ((strtolower($classname) == get_class($object))
or (is_subclass_of($object, $classname)));
}
}
------------------------------------------------------------------
Include this at the beginning of your script and before any require/include statements. This should work for you.
Regards
Alexander