More efficient file exists check

This commit is contained in:
Len Kranendonk 2004-08-13 08:35:13 +00:00
parent 22994e8373
commit d225fb428c

View file

@ -231,10 +231,10 @@ sub process {
unless (-f $file->getPath) { unless (-f $file->getPath) {
($template) = WebGUI::SQL->quickArray("select template from template where templateId=".$templateId." and namespace=".quote($namespace),WebGUI::SQL->getSlave); ($template) = WebGUI::SQL->quickArray("select template from template where templateId=".$templateId." and namespace=".quote($namespace),WebGUI::SQL->getSlave);
$file->saveFromScalar($template); $file->saveFromScalar($template);
} unless (-f $file->getPath) {
unless (-f $file->getPath) { WebGUI::ErrorHandler::warn("Could not create file ".$file->getPath."\nTemplate file caching is disabled");
WebGUI::ErrorHandler::warn("Could not create file ".$file->getPath."\nTemplate file caching is disabled"); $params{scalarref} = \$template;
$params{scalarref} = \$template; }
} }
return _execute(\%params,$vars); return _execute(\%params,$vars);
} }