Changeset 2816
- Timestamp:
- Nov 1, 2008, 10:22:08 PM (16 years ago)
- Location:
- branches/2.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/admin/include/functions_upgrade.php
r2516 r2816 95 95 } 96 96 97 // Deactivate all non-standard plugins 98 function deactivate_non_standard_plugins() 99 { 100 global $page; 101 102 $standard_plugins = array( 103 'add_index', 104 'admin_advices', 105 'admin_multi_view', 106 'c13y_upgrade', 107 'event_tracer', 108 'language_switch', 109 'LocalFilesEditor' 110 ); 111 112 $query = ' 113 SELECT id 114 FROM '.PREFIX_TABLE.'plugins 115 WHERE state = "active" 116 AND id NOT IN ("' . implode('","', $standard_plugins) . '") 117 ;'; 118 119 $result = pwg_query($query); 120 $plugins = array(); 121 while ($row = mysql_fetch_assoc($result)) 122 { 123 array_push($plugins, $row['id']); 124 } 125 126 if (!empty($plugins)) 127 { 128 $query = ' 129 UPDATE '.PREFIX_TABLE.'plugins 130 SET state="inactive" 131 WHERE id IN ("' . implode('","', $plugins) . '") 132 ;'; 133 mysql_query($query); 134 135 array_push( 136 $page['infos'], 137 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them: 138 <pre>' . implode(', ', $plugins) . '</pre>' 139 ); 140 } 141 } 142 97 143 ?> -
branches/2.0/install/upgrade_1.7.0.php
r2754 r2816 34 34 } 35 35 36 define('PREFIX_TABLE', $prefixeTable);37 36 define('UPGRADES_PATH', PHPWG_ROOT_PATH.'install/db'); 38 37 … … 69 68 'id' => $upgrade_id, 70 69 'applied' => CURRENT_DATE, 71 'description' => '[migration from 1.7.0 to '. RELEASE.'] not applied',70 'description' => '[migration from 1.7.0 to '.PHPWG_VERSION.'] not applied', 72 71 ) 73 72 ); 74 73 } 75 mass_inserts( 76 '`'.UPGRADE_TABLE.'`', 77 array_keys($inserts[0]), 78 $inserts 79 ); 74 75 if (!empty($inserts)) 76 { 77 mass_inserts( 78 '`'.UPGRADE_TABLE.'`', 79 array_keys($inserts[0]), 80 $inserts 81 ); 82 } 80 83 81 84 // +-----------------------------------------------------------------------+ … … 107 110 (id, applied, description) 108 111 VALUES 109 (\''.$upgrade_id.'\', NOW(), \'[migration from 1.7.0 to '. RELEASE.'] '.$upgrade_description.'\')112 (\''.$upgrade_id.'\', NOW(), \'[migration from 1.7.0 to '.PHPWG_VERSION.'] '.$upgrade_description.'\') 110 113 ;'; 111 114 pwg_query($query); -
branches/2.0/upgrade.php
r2811 r2816 238 238 if (in_array(PREFIX_TABLE.'plugins', $tables)) 239 239 { 240 $query = ' 241 UPDATE '.PREFIX_TABLE.'plugins SET state="inactive" WHERE state="active" 242 ;'; 243 mysql_query($query); 244 245 if (mysql_affected_rows() > 0) 246 { 247 array_push( 248 $page['infos'], 249 'As a precaution, all activated plugins have been deactivated. 250 You must check for plugins upgrade before reactiving them.' 251 ); 252 } 240 deactivate_non_standard_plugins(); 253 241 } 254 242
Note: See TracChangeset
for help on using the changeset viewer.