v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@ -70,7 +70,7 @@ class Versions
// Check core first
$url = 'core/version/' . $info['akaunting'] . '/' . $info['php'] . '/' . $info['mysql'] . '/' . $info['companies'];
$data['core'] = static::getLatestVersion($url);
$data['core'] = static::getLatestVersion($url, $info['akaunting']);
// Then modules
foreach ($modules as $module) {
@ -79,7 +79,7 @@ class Versions
$url = 'apps/' . $alias . '/version/' . $version . '/' . $info['akaunting'];
$data[$alias] = static::getLatestVersion($url);
$data[$alias] = static::getLatestVersion($url, $version);
}
Cache::put('versions', $data, Date::now()->addHour(6));
@ -87,11 +87,9 @@ class Versions
return $data;
}
public static function getLatestVersion($url)
public static function getLatestVersion($url, $latest)
{
$latest = '0.0.0';
$response = static::getRemote($url, ['timeout' => 10, 'referer' => true]);
$response = static::getRemote($url, 'GET', ['timeout' => 10, 'referer' => true]);
// Exception
if ($response instanceof RequestException) {