Changeset 12802 for trunk/include/template.class.php
- Timestamp:
- Dec 29, 2011, 6:48:16 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r12656 r12802 60 60 $this->smarty->force_compile = $conf['template_force_compile']; 61 61 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)) 66 67 { 67 68 load_language('admin.lang'); … … 69 70 sprintf( 70 71 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'] 72 73 ), 73 74 l10n('an error happened'), … … 76 77 } 77 78 if (function_exists('pwg_query')) { 78 conf_update_param(' local_data_dir_checked', 'true');79 conf_update_param('data_dir_checked', 1); 79 80 } 80 81 } … … 82 83 if (!isset($conf['combined_dir_checked'])) 83 84 { 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)) 86 88 { 87 89 load_language('admin.lang'); … … 96 98 } 97 99 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'; 104 106 mkgetdir( $compile_dir ); 105 107 … … 1182 1184 final class FileCombiner 1183 1185 { 1184 const OUT_SUB_DIR = PWG_COMBINED_DIR;1185 1186 private $type; // js or css 1186 1187 private $files = array(); … … 1194 1195 static function clear_combined_files() 1195 1196 { 1196 $dir = opendir(PHPWG_ROOT_PATH. self::OUT_SUB_DIR);1197 $dir = opendir(PHPWG_ROOT_PATH.PWG_COMBINED_DIR); 1197 1198 while ($file = readdir($dir)) 1198 1199 { 1199 1200 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); 1201 1202 } 1202 1203 closedir($dir); … … 1243 1244 1244 1245 $file = base_convert(crc32($key),10,36); 1245 $file = self::OUT_SUB_DIR . $file . '.' . $this->type;1246 $file = PWG_COMBINED_DIR . $file . '.' . $this->type; 1246 1247 1247 1248 $exists = file_exists( PHPWG_ROOT_PATH . $file );
Note: See TracChangeset
for help on using the changeset viewer.