diff options
author | patdenice <patdenice@piwigo.org> | 2011-05-25 09:57:56 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2011-05-25 09:57:56 +0000 |
commit | 639a18d13fcede5f841aa67529ddd91a4acc1b5d (patch) | |
tree | 4a03369c0c460a3222187575dd6c436f92b98567 /admin/include/plugins.class.php | |
parent | 663d72e06306108d1b06ae0919c6bf8325c2a9f5 (diff) |
feature:2250
Add obsolete_extensions.list file in install directory.
Incompatible plugins is checked through ajax.
git-svn-id: http://piwigo.org/svn/branches/2.2@11043 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include/plugins.class.php')
-rw-r--r-- | admin/include/plugins.class.php | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/admin/include/plugins.class.php b/admin/include/plugins.class.php index 30242f01b..fc2191ff2 100644 --- a/admin/include/plugins.class.php +++ b/admin/include/plugins.class.php @@ -556,30 +556,20 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id=\'' . $plugin_id . '\''; function get_merged_extensions($version=PHPWG_VERSION) { - if (isset($_SESSION['merged_extensions']) and $_SESSION['merged_extensions']['~~expire~~'] > time()) - { - return $_SESSION['merged_extensions']; - } - - $_SESSION['merged_extensions'] = array('~~expire~~' => time() + 600); + $file = PHPWG_ROOT_PATH.'install/obsolete_extensions.list'; + $merged_extensions = array(); - if (fetchRemote(PHPWG_URL.'/download/merged_extensions.txt', $result)) + if (file_exists($file) and $obsolete_ext = file($file, FILE_IGNORE_NEW_LINES) and !empty($obsolete_ext)) { - $rows = explode("\n", $result); - foreach ($rows as $row) + foreach ($obsolete_ext as $ext) { - if (preg_match('/^(\d+\.\d+): *(.*)$/', $row, $match)) + if (preg_match('/^(\d+) ?: ?(.*?)$/', $ext, $matches)) { - if (version_compare($version, $match[1], '>=')) - { - $extensions = explode(',', trim($match[2])); - $_SESSION['merged_extensions'] = array_merge($_SESSION['merged_extensions'], $extensions); - } + $merged_extensions[$matches[1]] = $matches[2]; } } } - - return $_SESSION['merged_extensions']; + return $merged_extensions; } /** |