mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-27 05:11:41 +02:00
cache version number parsed from changelog for 5min on tree level
This commit is contained in:
parent
aa7666baac
commit
b0de2d57a6
@ -1168,17 +1168,21 @@ abstract class egw_framework
|
|||||||
*/
|
*/
|
||||||
public static function api_version(&$changelog=null)
|
public static function api_version(&$changelog=null)
|
||||||
{
|
{
|
||||||
$version = preg_replace('/[^0-9.]/', '', $GLOBALS['egw_info']['server']['versions']['phpgwapi']);
|
|
||||||
// parse version from changelog
|
|
||||||
$changelog = EGW_SERVER_ROOT.'/doc/rpm-build/debian.changes';
|
$changelog = EGW_SERVER_ROOT.'/doc/rpm-build/debian.changes';
|
||||||
$matches = null;
|
|
||||||
if (($f = fopen($changelog, 'r')) && preg_match('/egroupware-epl \(([0-9.]+)/', fread($f, 80), $matches) &&
|
return egw_cache::getTree(__CLASS__, 'api_version', function() use ($changelog)
|
||||||
version_compare($version, $matches[1], '<'))
|
|
||||||
{
|
{
|
||||||
$version = $matches[1];
|
$version = preg_replace('/[^0-9.]/', '', $GLOBALS['egw_info']['server']['versions']['phpgwapi']);
|
||||||
fclose($f);
|
// parse version from changelog
|
||||||
}
|
$matches = null;
|
||||||
return $version;
|
if (($f = fopen($changelog, 'r')) && preg_match('/egroupware-epl \(([0-9.]+)/', fread($f, 80), $matches) &&
|
||||||
|
version_compare($version, $matches[1], '<'))
|
||||||
|
{
|
||||||
|
$version = $matches[1];
|
||||||
|
fclose($f);
|
||||||
|
}
|
||||||
|
return $version;
|
||||||
|
}, array(), 300);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user