Changeset 12802
- Timestamp:
- Dec 29, 2011, 6:48:16 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/updates.class.php
r12261 r12802 317 317 include(PHPWG_ROOT_PATH.'admin/include/mysqldump.php'); 318 318 319 $path = $conf['local_data_dir'].'/update';319 $path = PHPWG_ROOT_PATH.$conf['data_location'].'update'; 320 320 321 321 if (@mkgetdir($path) … … 351 351 352 352 @readfile($backupFile); 353 self::deltree( $conf['local_data_dir'].'/update');353 self::deltree(PHPWG_ROOT_PATH.$conf['data_location'].'update'); 354 354 exit(); 355 355 } … … 387 387 if (empty($page['errors'])) 388 388 { 389 $path = $conf['local_data_dir'].'/update';389 $path = PHPWG_ROOT_PATH.$conf['data_location'].'update'; 390 390 $filename = $path.'/'.$code.'.zip'; 391 391 @mkgetdir($path); … … 450 450 { 451 451 self::process_obsolete_list($obsolete_list); 452 self::deltree( $conf['local_data_dir'].'/update');452 self::deltree(PHPWG_ROOT_PATH.$conf['data_location'].'update'); 453 453 invalidate_user_cache(true); 454 454 $template->delete_compiled_templates(); … … 466 466 else 467 467 { 468 file_put_contents($conf['local_data_dir'].'/update/log_error.txt', $error); 469 $relative_path = trim(str_replace(dirname(dirname(dirname(dirname(__FILE__)))), '', $conf['local_data_dir']), '/\\'); 468 file_put_contents(PHPWG_ROOT_PATH.$conf['data_location'].'update/log_error.txt', $error); 470 469 array_push( 471 470 $page['errors'], 472 471 sprintf( 473 472 l10n('An error has occured during extract. Please check files permissions of your piwigo installation.<br><a href="%s">Click here to show log error</a>.'), 474 PHPWG_ROOT_PATH.$relative_path.'/update/log_error.txt'473 get_root_url().$conf['data_location'].'update/log_error.txt' 475 474 ) 476 475 ); … … 479 478 else 480 479 { 481 self::deltree( $conf['local_data_dir'].'/update');480 self::deltree(PHPWG_ROOT_PATH.$conf['data_location'].'update'); 482 481 array_push($page['errors'], l10n('An error has occured during upgrade.')); 483 482 } -
trunk/feed.php
r8728 r12802 194 194 } 195 195 196 $fileName= $conf['local_data_dir'].'/tmp';196 $fileName= PHPWG_ROOT_PATH.$conf['data_location'].'tmp'; 197 197 mkgetdir($fileName); // just in case 198 198 $fileName.='/feed.xml'; -
trunk/i.php
r12798 r12802 27 27 28 28 defined('PWG_LOCAL_DIR') or define('PWG_LOCAL_DIR', 'local/'); 29 defined('PWG_DERIVATIVE_DIR') or define('PWG_DERIVATIVE_DIR', PWG_LOCAL_DIR.'i/');29 defined('PWG_DERIVATIVE_DIR') or define('PWG_DERIVATIVE_DIR', $conf['data_location'].'i/'); 30 30 31 31 function trigger_action() {} -
trunk/include/common.inc.php
r12796 r12802 89 89 include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); 90 90 @include(PHPWG_ROOT_PATH. 'local/config/config.inc.php'); 91 if (!isset($conf['local_data_dir'])) $conf['local_data_dir'] = realpath(PHPWG_ROOT_PATH.$conf['data_location']); // temp 2.4 for backward compatibility 92 91 93 defined('PWG_LOCAL_DIR') or define('PWG_LOCAL_DIR', 'local/'); 92 94 -
trunk/include/config_default.inc.php
r12796 r12802 720 720 $conf['light_slideshow'] = true; 721 721 722 // the local data directory is used to store data such as compiled templates 723 // or other plugin variables etc 724 $conf['local_data_dir'] = dirname(dirname(__FILE__)).'/_data'; 722 // the local data directory is used to store data such as compiled templates, 723 // plugin variables, combined css/javascript or resized images. Beware of 724 // mandatory trailing slash. 725 $conf['data_location'] = '_data/'; 725 726 726 727 // where should the API/UploadForm add photos? This path must be relative to … … 757 758 $conf['derivative_url_style']=0; 758 759 759 $conf['chmod_value']=0777; 760 760 $conf['chmod_value']= substr_compare(PHP_SAPI, 'apa', 0, 3)==0 ? 0777 : 0755; 761 761 ?> -
trunk/include/constants.php
r12796 r12802 28 28 29 29 define('PHPWG_THEMES_PATH', $conf['themes_dir'].'/'); 30 defined('PWG_COMBINED_DIR') or define('PWG_COMBINED_DIR', PWG_LOCAL_DIR.'combined/');31 defined('PWG_DERIVATIVE_DIR') or define('PWG_DERIVATIVE_DIR', PWG_LOCAL_DIR.'i/');30 defined('PWG_COMBINED_DIR') or define('PWG_COMBINED_DIR', $conf['data_location'].'combined/'); 31 defined('PWG_DERIVATIVE_DIR') or define('PWG_DERIVATIVE_DIR', $conf['data_location'].'i/'); 32 32 33 33 // Required versions -
trunk/include/dblayer/functions_pdo-sqlite.inc.php
r11991 r12802 38 38 global $conf; 39 39 40 $db_file = sprintf('sqlite:%s/%s.db', $conf['local_data_dir'], $database);40 $db_file = sprintf('sqlite:%s/%s.db', PHPWG_ROOT_PATH.$conf['data_location'], $database); 41 41 42 42 $link = new PDO($db_file); -
trunk/include/dblayer/functions_sqlite.inc.php
r11991 r12802 38 38 global $conf; 39 39 40 $db_file = sprintf('%s/%s.db', $conf['local_data_dir'], $database);40 $db_file = sprintf('%s/%s.db', PHPWG_ROOT_PATH.$conf['data_location'], $database); 41 41 42 42 if (script_basename()=='install') -
trunk/include/functions_mail.inc.php
r9360 r12802 792 792 { 793 793 global $conf, $user, $lang_info; 794 $dir = $conf['local_data_dir'].'/tmp';794 $dir = PHPWG_ROOT_PATH.$conf['data_location'].'tmp'; 795 795 if ( mkgetdir( $dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR) ) 796 796 { -
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 ); -
trunk/install.php
r12769 r12802 111 111 112 112 // download database config file if exists 113 if (!empty($_GET['dl']) && file_exists( $conf['local_data_dir'].'/pwg_'.$_GET['dl']))114 { 115 $filename = $conf['local_data_dir'].'/pwg_'.$_GET['dl'];113 if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'])) 114 { 115 $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']; 116 116 header('Cache-Control: no-cache, must-revalidate'); 117 117 header('Pragma: no-cache'); … … 282 282 { 283 283 $tmp_filename = md5(uniqid(time())); 284 $fh = @fopen( $conf['local_data_dir'] . '/pwg_' . $tmp_filename, 'w' );284 $fh = @fopen( PHPWG_ROOT_PATH.$conf['data_location'] . 'pwg_' . $tmp_filename, 'w' ); 285 285 @fputs($fh, $file_content, strlen($file_content)); 286 286 @fclose($fh); -
trunk/install/db/94-database.php
r11509 r12802 61 61 62 62 // save configuration for a future use by the Community plugin 63 $backup_filepath = $conf['local_data_dir'].'/plugins/core_user_upload_to_community.php';63 $backup_filepath = PHPWG_ROOT_PATH.$conf['data_location'].'plugins/core_user_upload_to_community.php'; 64 64 $save_conf = true; 65 65 if (is_dir(dirname($backup_filepath))) … … 70 70 } 71 71 } 72 elseif (!is_writable( $conf['local_data_dir']))72 elseif (!is_writable( PHPWG_ROOT_PATH.$conf['data_location'] )) 73 73 { 74 74 $save_conf = false;
Note: See TracChangeset
for help on using the changeset viewer.