Changeset 10128
- Timestamp:
- Apr 7, 2011, 11:11:11 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/plugins.class.php
r10098 r10128 372 372 } 373 373 374 function get_incompatible_plugins() 375 { 376 if (isset($_SESSION['incompatible_plugins'])) 374 function get_incompatible_plugins($actualize=false) 375 { 376 if (isset($_SESSION['incompatible_plugins']) and !$actualize 377 and $_SESSION['incompatible_plugins']['~~expire~~'] > time()) 377 378 { 378 379 return $_SESSION['incompatible_plugins']; 379 380 } 380 381 381 $_SESSION['incompatible_plugins'] = array( );382 $_SESSION['incompatible_plugins'] = array('~~expire~~' => time() + 300); 382 383 383 384 $versions_to_check = $this->get_versions_to_check(); … … 559 560 function get_merged_extensions($version=PHPWG_VERSION) 560 561 { 561 if (!isset($_SESSION['merged_extensions'])) 562 { 563 $_SESSION['merged_extensions'] = array(); 564 if (fetchRemote(MERGED_EXTENSIONS_URL, $result)) 565 { 566 $rows = explode("\n", $result); 567 foreach ($rows as $row) 568 { 569 if (preg_match('/^(\d+\.\d+): *(.*)$/', $row, $match)) 570 { 571 if (version_compare($version, $match[1], '>=')) 572 { 573 $extensions = explode(',', trim($match[2])); 574 $_SESSION['merged_extensions'] = array_merge($_SESSION['merged_extensions'], $extensions); 575 } 576 } 577 } 578 } 579 } 562 if (isset($_SESSION['merged_extensions']) and $_SESSION['merged_extensions']['~~expire~~'] > time()) 563 { 564 return $_SESSION['merged_extensions']; 565 } 566 567 $_SESSION['merged_extensions'] = array('~~expire~~' => time() + 600); 568 569 if (fetchRemote(PHPWG_URL.'/download/merged_extensions.txt', $result)) 570 { 571 $rows = explode("\n", $result); 572 foreach ($rows as $row) 573 { 574 if (preg_match('/^(\d+\.\d+): *(.*)$/', $row, $match)) 575 { 576 if (version_compare($version, $match[1], '>=')) 577 { 578 $extensions = explode(',', trim($match[2])); 579 $_SESSION['merged_extensions'] = array_merge($_SESSION['merged_extensions'], $extensions); 580 } 581 } 582 } 583 } 584 580 585 return $_SESSION['merged_extensions']; 581 586 } -
trunk/admin/plugins_list.php
r10101 r10128 78 78 { 79 79 // Incompatible plugins must be reinitilized 80 unset($_SESSION['incompatible_plugins']); 81 $plugins->get_incompatible_plugins(); 80 $plugins->get_incompatible_plugins(true); 82 81 } 83 82 -
trunk/include/common.inc.php
r10098 r10128 157 157 define('PEM_URL', 'http://'.PHPWG_DOMAIN.'/ext'); 158 158 } 159 define('MERGED_EXTENSIONS_URL', 'http://'.PHPWG_DOMAIN.'/download/merged_extensions.txt');160 161 159 162 160 // language files
Note: See TracChangeset
for help on using the changeset viewer.