aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/plugins.class.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2011-05-25 10:54:59 +0000
committerpatdenice <patdenice@piwigo.org>2011-05-25 10:54:59 +0000
commitd8718a6d73cb203f3875f31dc38c2978e0484834 (patch)
tree08881e707cbb2730ac2daa38a5e1a429b67c10f3 /admin/include/plugins.class.php
parentd9fbe9bbe9a7686fd85e0ad6e3a21bdf07b87c5c (diff)
merge r11043 from branch 2.2 to trunk
feature:2250 Add obsolete_extensions.list file in install directory. Incompatible plugins is checked through ajax. git-svn-id: http://piwigo.org/svn/trunk@11047 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/plugins.class.php24
1 files changed, 7 insertions, 17 deletions
diff --git a/admin/include/plugins.class.php b/admin/include/plugins.class.php
index d1b8f5c5b..22e58857c 100644
--- a/admin/include/plugins.class.php
+++ b/admin/include/plugins.class.php
@@ -534,30 +534,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;
}
/**