Request: add betterStates() to PEAR_Common class

From: Date: Fri, 22 Aug 2003 06:49:26 +0000
Subject: Request: add betterStates() to PEAR_Common class
Groups: php.pear.dev php.pear.webmaster 
Request: Send a blank email to pear-dev+get-20361@lists.php.net to get a copy of this message
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 ;) Greg

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