Ignore:
Timestamp:
Dec 29, 2011, 6:48:16 AM (12 years ago)
Author:
rvelices
Message:

fetaure 2542 replace $conflocal_data_dir with $confdata_location and move combined files and image derivatives from local to _data

File:
1 edited

Legend:

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

    r12656 r12802  
    6060    $this->smarty->force_compile = $conf['template_force_compile'];
    6161
    62     if (!isset($conf['local_data_dir_checked']))
    63     {
    64       mkgetdir($conf['local_data_dir'], MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
    65       if (!is_writable($conf['local_data_dir']))
     62    if (!isset($conf['data_dir_checked']))
     63    {
     64      $dir = PHPWG_ROOT_PATH.$conf['data_location'];
     65      mkgetdir($dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
     66      if (!is_writable($dir))
    6667      {
    6768        load_language('admin.lang');
     
    6970          sprintf(
    7071            l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'),
    71             basename($conf['local_data_dir'])
     72            $conf['data_location']
    7273            ),
    7374          l10n('an error happened'),
     
    7677      }
    7778      if (function_exists('pwg_query')) {
    78         conf_update_param('local_data_dir_checked', 'true');
     79        conf_update_param('data_dir_checked', 1);
    7980      }
    8081    }
     
    8283    if (!isset($conf['combined_dir_checked']))
    8384    {
    84       mkgetdir(PWG_COMBINED_DIR, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
    85       if (!is_writable(PWG_COMBINED_DIR))
     85      $dir = PHPWG_ROOT_PATH.PWG_COMBINED_DIR;
     86      mkgetdir($dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
     87      if (!is_writable($dir))
    8688      {
    8789        load_language('admin.lang');
     
    9698      }
    9799      if (function_exists('pwg_query')) {
    98         conf_update_param('combined_dir_checked', 'true');
    99       }
    100     }
    101 
    102 
    103     $compile_dir = $conf['local_data_dir'].'/templates_c';
     100        conf_update_param('combined_dir_checked', 1);
     101      }
     102    }
     103
     104
     105    $compile_dir = PHPWG_ROOT_PATH.$conf['data_location'].'templates_c';
    104106    mkgetdir( $compile_dir );
    105107
     
    11821184final class FileCombiner
    11831185{
    1184   const OUT_SUB_DIR = PWG_COMBINED_DIR;
    11851186  private $type; // js or css
    11861187  private $files = array();
     
    11941195  static function clear_combined_files()
    11951196  {
    1196     $dir = opendir(PHPWG_ROOT_PATH.self::OUT_SUB_DIR);
     1197    $dir = opendir(PHPWG_ROOT_PATH.PWG_COMBINED_DIR);
    11971198    while ($file = readdir($dir))
    11981199    {
    11991200      if ( get_extension($file)=='js' || get_extension($file)=='css')
    1200         unlink(PHPWG_ROOT_PATH.self::OUT_SUB_DIR.$file);
     1201        unlink(PHPWG_ROOT_PATH.PWG_COMBINED_DIR.$file);
    12011202    }
    12021203    closedir($dir);
     
    12431244
    12441245    $file = base_convert(crc32($key),10,36);
    1245     $file = self::OUT_SUB_DIR . $file . '.' . $this->type;
     1246    $file = PWG_COMBINED_DIR . $file . '.' . $this->type;
    12461247
    12471248    $exists = file_exists( PHPWG_ROOT_PATH . $file );
Note: See TracChangeset for help on using the changeset viewer.