Changeset 11047 for trunk/admin/include
- Timestamp:
- May 25, 2011, 12:54:59 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/plugins.class.php
r10594 r11047 535 535 function get_merged_extensions($version=PHPWG_VERSION) 536 536 { 537 if (isset($_SESSION['merged_extensions']) and $_SESSION['merged_extensions']['~~expire~~'] > time()) 538 { 539 return $_SESSION['merged_extensions']; 540 } 541 542 $_SESSION['merged_extensions'] = array('~~expire~~' => time() + 600); 543 544 if (fetchRemote(PHPWG_URL.'/download/merged_extensions.txt', $result)) 545 { 546 $rows = explode("\n", $result); 547 foreach ($rows as $row) 548 { 549 if (preg_match('/^(\d+\.\d+): *(.*)$/', $row, $match)) 550 { 551 if (version_compare($version, $match[1], '>=')) 552 { 553 $extensions = explode(',', trim($match[2])); 554 $_SESSION['merged_extensions'] = array_merge($_SESSION['merged_extensions'], $extensions); 555 } 556 } 557 } 558 } 559 560 return $_SESSION['merged_extensions']; 537 $file = PHPWG_ROOT_PATH.'install/obsolete_extensions.list'; 538 $merged_extensions = array(); 539 540 if (file_exists($file) and $obsolete_ext = file($file, FILE_IGNORE_NEW_LINES) and !empty($obsolete_ext)) 541 { 542 foreach ($obsolete_ext as $ext) 543 { 544 if (preg_match('/^(\d+) ?: ?(.*?)$/', $ext, $matches)) 545 { 546 $merged_extensions[$matches[1]] = $matches[2]; 547 } 548 } 549 } 550 return $merged_extensions; 561 551 } 562 552
Note: See TracChangeset
for help on using the changeset viewer.