Changeset 1027
- Timestamp:
- Feb 6, 2006, 10:52:16 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/common.inc.php
r960 r1027 135 135 if ($conf['check_upgrade_feed']) 136 136 { 137 define('PREFIX_TABLE', $prefixeTable);138 define('UPGRADES_PATH', PHPWG_ROOT_PATH.'install/db');139 140 137 // retrieve already applied upgrades 141 138 $query = ' 142 139 SELECT id 143 FROM '. PREFIX_TABLE.'upgrade140 FROM '.UPGRADE_TABLE.' 144 141 ;'; 145 142 $applied = array_from_query($query, 'id'); 146 143 147 144 // retrieve existing upgrades 148 $existing = array(); 149 150 if ($contents = opendir(UPGRADES_PATH)) 151 { 152 while (($node = readdir($contents)) !== false) 153 { 154 if (is_file(UPGRADES_PATH.'/'.$node) 155 and preg_match('/^(.*?)-database\.php$/', $node, $match)) 156 { 157 array_push($existing, $match[1]); 158 } 159 } 160 } 161 natcasesort($existing); 145 $existing = get_available_upgrade_ids(); 162 146 163 147 // which upgrades need to be applied? -
trunk/include/functions.inc.php
r1021 r1027 489 489 function redirect( $url ) 490 490 { 491 global $user, $template, $lang_info, $conf, $lang, $t2, $page ;491 global $user, $template, $lang_info, $conf, $lang, $t2, $page, $debug; 492 492 493 493 // $refresh, $url_link and $title are required for creating an automated … … 973 973 return $email; 974 974 } 975 976 /** 977 * which upgrades are available ? 978 * 979 * @return array 980 */ 981 function get_available_upgrade_ids() 982 { 983 $upgrades_path = PHPWG_ROOT_PATH.'install/db'; 984 985 $available_upgrade_ids = array(); 986 987 if ($contents = opendir($upgrades_path)) 988 { 989 while (($node = readdir($contents)) !== false) 990 { 991 if (is_file($upgrades_path.'/'.$node) 992 and preg_match('/^(.*?)-database\.php$/', $node, $match)) 993 { 994 array_push($available_upgrade_ids, $match[1]); 995 } 996 } 997 } 998 natcasesort($available_upgrade_ids); 999 1000 return $available_upgrade_ids; 1001 } 975 1002 ?> -
trunk/install.php
r860 r1027 339 339 ;'; 340 340 mysql_query($query); 341 342 // Available upgrades must be ignored after a fresh installation. To 343 // make PWG avoid upgrading, we must tell it upgrades have already been 344 // made. 345 foreach (get_available_upgrade_ids() as $upgrade_id) 346 { 347 $query = ' 348 INSERT INTO '.UPGRADE_TABLE.' 349 (id, applied, description) 350 VALUES 351 ('.$upgrade_id.', NOW(), \'upgrade included in installation\') 352 '; 353 mysql_query($query); 354 } 341 355 } 342 356 } -
trunk/upgrade_feed.php
r953 r1027 57 57 58 58 // retrieve existing upgrades 59 $existing = array(); 60 61 if ($contents = opendir(UPGRADES_PATH)) 62 { 63 while (($node = readdir($contents)) !== false) 64 { 65 if (is_file(UPGRADES_PATH.'/'.$node) 66 and preg_match('/^(.*?)-database\.php$/', $node, $match)) 67 { 68 array_push($existing, $match[1]); 69 } 70 } 71 } 72 natcasesort($existing); 59 $existing = get_available_upgrade_ids(); 73 60 74 61 // which upgrades need to be applied?
Note: See TracChangeset
for help on using the changeset viewer.