RE: new error checking
| From: | Monte Ohrt | Date: | Fri, 30 May 2003 20:05:14 +0000 |
| Subject: | RE: new error checking | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1523@lists.php.net to get a copy of this message | ||
On Fri, 2003-05-30 at 14:47, boots wrote:
> ---- Monte Ohrt <monte@ispi.net> Wrote: -----
> > I added some error checking to the write_compiled_file and
> > write_cache_file routines to hopefully reduce some FAQs in the
> > forums.
>
> cool!
>
> It would be very cool if the error messages included links to the
> appropriate manual or FAQ entry.
>
> > If the directory is not writable, you will get an error like so:
>
> How about instead of is_writable, you actually attempt to write and
> then recover from a failed write attempt with:
I had thought about that, and did take caution to keep the overhead to
one function call. I figured since this is at write time, it isn't so
crucial to save every little ounce of processing at the expense of
making things a bit less maintainable. If we want the normal process to
fail first, it would have to continue into the write_file() routine,
then return a failure, then unravel the typically deep directory
structure it was trying to write, figure out the appropriate error, etc.
Also, I think the is_writable() information will already be cached by
PHP at this point since the file was already attempated to be read from
there. I could be wrong though :-)
Monte
>
> <b>Fatal error</b>: Smarty error: $compile_dir '/path/to/templates_c'
> is not available. Ensure $compile_dir is writable by the web
> server user. In <b>/path/to/libs/Smarty.class.php</b> on line
> <b>1087</b><br />
>
> xo boots
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
--
Monte Ohrt <monte@ispi.net>