Re: Request: add betterStates() to PEAR_Common class

From: Date: Wed, 27 Aug 2003 18:15:01 +0000
Subject: Re: Request: add betterStates() to PEAR_Common class
References: 1 2  Groups: php.pear.dev php.pear.webmaster 
Request: Send a blank email to pear-dev+get-20666@lists.php.net to get a copy of this message
I copied this directly from pearweb, so if you'd like to switch the order, I'd discuss that in pear-group and with Martin directly. Regards, Greg Tomas V.V.Cox wrote:
On Friday, August 22, 2003 8:49, Greg Beaver wrote:
Hi,
In order to implement automatic dependency resolution, it looks like I will need a copy of the betterStates() method from pearweb's include/pear-database.php. Is there any objection to copying this method verbatim to the PEAR/Common.php PEAR_Common class? It would obviously require updating any time the release states are changed, but the states seem pretty stable.
source:
    /**
     * ???
     *
     * @param string Release state
     * @return boolean
     */
    function betterStates($state)
    {
        static $states = array('devel', 'snapshot', 'alpha', 'beta', 'stable');
        $i = array_search($state, $states);
        if ($i === false) {
            return false;
        }
        return array_slice($states, $i + 1);
    }
   
I think I can improve on the documentation a bit too ;)
I see no problem here. Just one thing: 'devel' is a distribution targeted to developers which has been prepared and perhaps tested for them. So I guess it's a better state than just a snapshot of the CVS code.


« previous php.pear.dev (#20666) next »