Re: Package proposal: HTTP_Status

From: Date: Tue, 26 Aug 2003 07:08:46 +0000
Subject: Re: Package proposal: HTTP_Status
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-20513@lists.php.net to get a copy of this message
Marshall Roch wrote:
Alan Knowles wrote:
I'd suggest someone does a status_codes.ini file and both (all?) packages share it..
Sounds feasible, but HTTP_Status provides other methods that are still useful. Also, I wonder if it's more work to parse an ini file than to include a file. I've never worked with ini files like that, so I have no idea.
ini files are probably marginally faster than a php array.. as the parser is slightly simpler than the php parser... I've never benchmarked it however... Regards Alan
from the code below it looks like constants are a bit messy for this..
Agreed, which is why I used an array. :)
I think your checks look a bit buggy... function isInformational($code) {
    // should this be < 200?
        if ($code >= 100 && $code > 200) {
            return true;
        }
        return false;
    }
Whoops! That's what I get for writing it wrong once and copy/pasting... That's fixed, as well as now using those shorthand if statements... -- Marshall Roch
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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