Changeset 10038
- Timestamp:
- Apr 4, 2011, 4:14:15 PM (14 years ago)
- Location:
- extensions/autoupdate/branches/2.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/autoupdate/branches/2.0
-
Property
svn:mergeinfo
set to
/extensions/autoupdate/trunk merged eligible
-
Property
svn:mergeinfo
set to
-
extensions/autoupdate/branches/2.0/autoupdate.php
r10029 r10038 123 123 include_once(AUTOUPDATE_PATH.'include/autoupdate.class.php'); 124 124 $autoupdate = new autoupdate(); 125 $autoupdate->get_merged_extensions($upgrade_to); 125 126 $autoupdate->get_server_extensions($upgrade_to); 126 127 $template->assign('missing', $autoupdate->missing); -
extensions/autoupdate/branches/2.0/include/autoupdate.class.php
r10029 r10038 8 8 var $plugins; 9 9 var $themes; 10 var $languages;11 10 var $missing = array(); 12 11 var $default_plugins = array(); 13 12 var $default_themes = array(); 13 var $merged_extensions = array(); 14 var $merged_extension_url = 'http://piwigo.org/download/merged_extensions.txt'; 14 15 15 16 function autoupdate() … … 199 200 foreach ($this->$type->$fs as $ext_id => $ext) 200 201 { 201 if (isset($ext['extension']) and $id == $ext['extension'] and !in_array($ext_id, $this->$default)) 202 if (isset($ext['extension']) and $id == $ext['extension'] 203 and !in_array($ext_id, $this->$default) 204 and !in_array($ext['extension'], $this->merged_extensions)) 202 205 { 203 206 $this->missing[$type][] = $ext; … … 208 211 } 209 212 213 function get_merged_extensions($version) 214 { 215 if (fetchRemote($this->merged_extension_url, $result)) 216 { 217 $rows = explode("\n", $result); 218 foreach ($rows as $row) 219 { 220 if (preg_match('/^(\d+\.\d+): *(.*)$/', $row, $match)) 221 { 222 if (version_compare($version, $match[1], '>=')) 223 { 224 $extensions = explode(',', trim($match[2])); 225 $this->merged_extensions = array_merge($this->merged_extensions, $extensions); 226 } 227 } 228 } 229 } 230 } 231 210 232 function version_compare($a, $b, $type) 211 233 {
Note: See TracChangeset
for help on using the changeset viewer.