[dev] Re: [cvs] commit: chora annotate.php cvs.php diff.php history.phpchora/docsCHANGES chora/lib Chora.php

Anil Madhavapeddy anil@recoil.org
Wed, 21 Aug 2002 21:05:15 +0100


On Wed, Aug 21, 2002 at 08:26:14AM -0400, Jon Parise wrote:
>    
> From your changes to Chora.php:
> 
> +    /* If we hit a 40x, then don't store the bad file in the preference */
> +    if (preg_match('|40[43]|', $errcode) && is_object($prefs)) {
> +        $prefs->setValue('last_file', '');
> +        $prefs->store();
> +    }
> 
> This made me wonder why $errcode is being passed around as a string
> (i.e. "404 Not Found").  Perhaps we could just pass the numeric code
> to fatal(), which could could in turn use a static mapping to build
> the complete Status: header?

Yeah, it was just a quick hack to make it work.  I wanted to rewrite
it 'properly' by moving all the non-class code in Chora.php into an
initialization routine instead.  Right now there's still a lot of stuff
left over from Chuck's original perl port which I didn't clean up!

Actually, CVSLib_Error takes the numeric values and converts to
error codes; perhaps those would be good error objects to pass around.

Anil