Welcome! » Log In » Create A New Profile

Suggestions: Don't fatal error on no place to store cache. example code on demo

Posted by jmut 
Suggestions: Don't fatal error on no place to store cache. example code on demo
February 01, 2009 03:51PM

Hi, Great tool indeed. I have couple of suggestions and not sure where to put them.

1. I don't think there should be fatal error when cache directory is not writable. Warning or something yes but this should not terminate script execution

2. on demo page where it's possible to configure this and that and paste html to purify I think it would be good idea to show php code that's created for this purify thingy. Will be invaluable help for beginners.

Cheers

Re: Suggestions: Don't fatal error on no place to store cache. example code on demo
February 01, 2009 05:14PM
On demo page where it's possible to configure this and that and paste html to purify I think it would be good idea to show php code that's created for this purify thingy. Will be invaluable help for beginners.

That's a great idea, and I've been meaning to do this for a long time.

I don't think there should be fatal error when cache directory is not writable. Warning or something yes but this should not terminate script execution

Hmm... while the error is not, by nature, fatal, I also feel like it's a good idea to yell at the user as quickly as possible when something is misconfigured, and a fatal error is a good way to do that.

Re: Suggestions: Don't fatal error on no place to store cache. example code on demo
February 02, 2009 04:34AM

Well yes, just in some weird cases by some crazy admin or so dir permissions might be changed. I don't think this should cause whole application to halt. If developer is good enough he'll follow one way or the other logs and figure it out. Much better in my opinion to slow down application (no caching) + warning instead of halt. Maybe I really mis understand the user invoked fatal. Maybe not halting after all :D If not..then all is cool.

Cheers

Re: Suggestions: Don't fatal error on no place to store cache. example code on demo
February 02, 2009 10:05AM

Understood. I will downgrade the error from E_USER_ERROR to E_USER_WARNING.

Re: Suggestions: Don't fatal error on no place to store cache. example code on demo
February 03, 2009 04:30AM

personally i think the fatal error is good.

as a developer myself, i agree with your points.. but as we have found, very often website users will use a package like a CMS or something, and if that CMS uses htmlpurifier then error messages are great for the webmaster, and remember, not all webmasters are developers, some wouldn't have a clue what to do.. but a fatal error stating that a directory isn't writeable, is clear enough english for most.

the biggest mistake that many projects make in the beginning, is to presume that the people using their software are all developers themselves.

Re: Suggestions: Don't fatal error on no place to store cache. example code on demo
February 03, 2009 09:58AM

Exactly :) And going fatal when this is really a non-fatal issue for the application will be no good :) Halt whole application just for that? Makese no sense in my opinion. After all, this is what warnings are about. Cheers. Up to the commander for final call :D

Re: Suggestions: Don't fatal error on no place to store cache. example code on demo
February 03, 2009 12:56PM

That's what convinced me. You will suffer a pretty severe performance hit if the cache isn't writable, but it is by no means the end of the world.

Sorry, you do not have permission to post/reply in this forum.