1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 01:25:01 +02:00

Fixes #1780 Plugin Manager now alerts user if a newer version of an installed plugin is available from e107.org

This commit is contained in:
Cameron
2016-10-25 16:24:53 -07:00
parent 0fb2d8d094
commit 3ba7181969
2 changed files with 64 additions and 100 deletions

View File

@@ -223,6 +223,53 @@ class e_marketplace
$this->adapter = null;
//echo "Adapter destroyed", PHP_EOL;
}
public function getVersionList($type='plugin')
{
$cache = e107::getCache();
$cache->setMD5('_', false);
$tag = 'Versions_'.$type;
if($data = $cache->retrieve($tag,(60 * 12), true, true))
{
return e107::unserialize($data);
}
// $mp = $this->getMarketplace();
// $mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass);
e107::getDebug()->log("Retrieving ".$type." version list from e107.org");
$xdata = $this->call('getList', array(
'type' => $type,
'params' => array('limit' => 200, 'search' => null, 'from' => 0)
));
$arr = array();
if(!empty($xdata['data']))
{
foreach($xdata['data'] as $row)
{
$k = $row['folder'];
$arr[$k] = $row;
}
}
// print_a($xdata['data']);
$data = e107::serialize($arr);
$cache->set($tag, $data, true, null, true);
return $arr;
}
}
abstract class e_marketplace_adapter_abstract