mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 19:59:56 +03:00
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
This commit is contained in:
parent
d9fbe9bbe9
commit
d8718a6d73
4 changed files with 61 additions and 39 deletions
|
@ -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'];
|
||||
}
|
||||
$file = PHPWG_ROOT_PATH.'install/obsolete_extensions.list';
|
||||
$merged_extensions = array();
|
||||
|
||||
$_SESSION['merged_extensions'] = array('~~expire~~' => time() + 600);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue