Changeset 5998


Ignore:
Timestamp:
Apr 29, 2010, 4:43:06 PM (10 years ago)
Author:
plg
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/template.class.php

    r5993 r5998  
    5353    $this->smarty->force_compile = $conf['template_force_compile'];
    5454
    55     if (!is_writable($conf['local_data_dir']))
    56     {
    57       load_language('admin.lang');
    58       fatal_error(
    59         sprintf(
    60           l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'),
    61           basename($conf['local_data_dir'])
    62           ),
    63         l10n('an error happened'),
    64         false // show trace
    65         );
    66     }
     55    if (!isset($conf['local_data_dir_checked']))
     56    {
     57      mkgetdir($conf['local_data_dir'], MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
     58      if (!is_writable($conf['local_data_dir']))
     59      {
     60        load_language('admin.lang');
     61        fatal_error(
     62          sprintf(
     63            l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'),
     64            basename($conf['local_data_dir'])
     65            ),
     66          l10n('an error happened'),
     67          false // show trace
     68          );
     69      }
     70      conf_update_param('local_data_dir_checked', 'true');
     71    }
     72   
    6773    $compile_dir = $conf['local_data_dir'].'/templates_c';
    6874    mkgetdir( $compile_dir );
Note: See TracChangeset for help on using the changeset viewer.