Skip to content

Commit

Permalink
bug 860 related: if the directory doesn't exist (SVN users) first try to
Browse files Browse the repository at this point in the history
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
  • Loading branch information
plegall committed Apr 29, 2010
1 parent 884c937 commit b8d3c9d
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions include/template.class.php
Expand Up @@ -52,18 +52,24 @@ function Template($root = ".", $theme= "", $path = "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 );

Expand Down

0 comments on commit b8d3c9d

Please sign in to comment.