|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
c960657 Smarty Regular
Joined: 07 May 2003 Posts: 75 Location: Copenhagen, Denmark
|
Posted: Mon Jun 28, 2004 4:06 pm Post subject: Two errors when $smarty->compile_dir is not writable |
|
|
If $smarty->compile_dir is not writable by the web server, Smarty throws two errors:
Quote: | Error: Smarty error: unable to write to $compile_dir '/var/tmp/smarty/templates_c/foobar'. Be sure $compile_dir is writable by the web server user.
Warning: fetch(/var/tmp/smarty/templates_c/foobar/%%A5/A5E/A5EBF147%%header.tpl.php): failed to open stream: No such file or directory |
I think only one error should be thrown - the second error is confusing. This can be fixed by changing Smarty::_compile_resource():
Code: | @@ -1420,9 +1420,7 @@
$_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content, 'resource_timestamp' => $_resource_timestamp);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php');
- smarty_core_write_compiled_resource($_params, $this);
-
- return true;
+ return smarty_core_write_compiled_resource($_params, $this);
} else {
return false;
}
|
This will make fetch() not try to include the non-existing compiled template. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Jun 28, 2004 4:19 pm Post subject: |
|
|
this suggestion sounds very reasonable to me. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|