aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-04-29 14:43:06 +0000
committerplegall <plg@piwigo.org>2010-04-29 14:43:06 +0000
commitb8d3c9dba4a5489cf9ba4c856cce96bc666a6714 (patch)
tree840995958c9e4f3bb31b643c20ab07a9265f2241
parent884c9375f3e35578ad67b9d58a41b97fef04949c (diff)
bug 860 related: if the directory doesn't exist (SVN users) first try to
create it. To avoid useless checks on filesystem (rvelices should appreciate) a configuration variable tells if we have to check or not. git-svn-id: http://piwigo.org/svn/trunk@5998 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/template.class.php26
1 files changed, 16 insertions, 10 deletions
diff --git a/include/template.class.php b/include/template.class.php
index f85bcc03f..dec4a9063 100644
--- a/include/template.class.php
+++ b/include/template.class.php
@@ -52,18 +52,24 @@ class Template {
$this->smarty->compile_check = $conf['template_compile_check'];
$this->smarty->force_compile = $conf['template_force_compile'];
- if (!is_writable($conf['local_data_dir']))
+ if (!isset($conf['local_data_dir_checked']))
{
- load_language('admin.lang');
- fatal_error(
- sprintf(
- l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'),
- basename($conf['local_data_dir'])
- ),
- l10n('an error happened'),
- false // show trace
- );
+ mkgetdir($conf['local_data_dir'], MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
+ if (!is_writable($conf['local_data_dir']))
+ {
+ load_language('admin.lang');
+ fatal_error(
+ sprintf(
+ l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'),
+ basename($conf['local_data_dir'])
+ ),
+ l10n('an error happened'),
+ false // show trace
+ );
+ }
+ conf_update_param('local_data_dir_checked', 'true');
}
+
$compile_dir = $conf['local_data_dir'].'/templates_c';
mkgetdir( $compile_dir );