new error checking

From: Date: Fri, 30 May 2003 19:36:59 +0000
Subject: new error checking
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1521@lists.php.net to get a copy of this message
I added some error checking to the write_compiled_file and write_cache_file routines to hopefully reduce some FAQs in the forums. Specifically, if the directory does not exist or is not a directory, you will get an error like so: <b>Fatal error</b>: Smarty error: the $compile_dir 'templates_c' does not exist, or is not a directory. in <b>/path/to/libs/Smarty.class.php</b> on line <b>1087</b><br /> If the directory is not writable, you will get an error like so: <b>Fatal error</b>: Smarty error: unable to write to $compile_dir '/path/to/templates_c'. Be sure $compile_dir is writable by the web server user. in <b>/path/to/libs/Smarty.class.php</b> on line <b>1087</b><br /> ... showing the resolved full system path to the given directory. As I write this, I now have a feeling that is_writable() will return true even when in safe_mode and directory creation is not allowed. Maybe another level of tests in create_dir_structure for this... Monte

« previous php.smarty.dev (#1521) next »