Fine by me.. makes sense. Guess you could also just create a second
method instead of modifying the signature of that one, but then it
might be difficult to make sure the exception you're catching (and
ignoring) is the one thrown for the file not existing, and not one for
the file being poorly formatted..
public static function checkConfigReturnBool($config)
{
try {
return(self::checkConfig($config));
} catch (ConfigurationException $ce) {
return(false);
}
}
Second param to checkConfig works for me though... probably makes more
sense in this case.
--Bob
On 9/10/05, David Zülke <[EMAIL PROTECTED]> wrote:
> Cheers guys,
>
> I was working on my CachingExecutionFilter a bit this morning and came
> across an issue. The general idea is that people just drop a "caching.ini"
> into their modules/modulename/config directory to enable caching for certain
> actions, based on certain parameters and so forth.
> Obviously, I want everything to work as usual if no config file exists. I'll
> be using ReturnArrayConfigHandler for that ini file, and I'd like to avoid
> checking if the file exists first. Stuff like that leads to too many nested
> if constructs.
>
> So... how about
>
> public static function checkConfig ($config, $reportFailure = true)
>
> ?
>
> Setting the second parameter to false would lead to no exception being
> thrown if the file does not exists. Instead, the method would return either
> null or false (I'd prefer the latter, since the check for the file failed,
> right?)
>
> Opinions please.
>
> - David
>
>
> _______________________________________________
> agavi-dev mailing list
> [email protected]
> http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev
>
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev