Fix additional repository file name

This commit is contained in:
RainLoop Team 2013-11-28 01:09:41 +04:00
parent 97987a1bac
commit c28f82a3b9
2 changed files with 25 additions and 15 deletions

View file

@ -2,7 +2,7 @@
"name": "RainLoop", "name": "RainLoop",
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"version": "1.4.2", "version": "1.4.2",
"release": "524", "release": "525",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net", "homepage": "http://rainloop.net",
"main": "Gruntfile.js", "main": "Gruntfile.js",

View file

@ -2224,26 +2224,35 @@ class Actions
return '' === $sCoreAccess || APP_SITE === $sCoreAccess; return '' === $sCoreAccess || APP_SITE === $sCoreAccess;
} }
private function getRepositoryDataByUrl($sRepo, &$bReal = false) /**
* @param string $sRepo
* @param bool $bReal = false
* @param bool $bMain = true
* @return array
*/
private function getRepositoryDataByUrl($sRepo, &$bReal = false, $bMain = true)
{ {
$bReal = false; $bReal = false;
$aRep = null; $aRep = null;
$sRep = ''; $sRep = '';
$sRepoType = \strtolower(\trim($this->Config()->Get('labs', 'repo_type', 'stable')));
$sRepoFile = 'repository.json'; $sRepoFile = 'repository.json';
$iRepTime = 0; $iRepTime = 0;
switch ($sRepoType) { if ($bMain)
case 'dev': {
case 'nightly': switch (\strtolower(\trim($this->Config()->Get('labs', 'repo_type', 'stable'))))
case 'beta': {
$sRepoFile = 'beta.repository.json'; case 'dev':
break; case 'nightly':
case 'stable': case 'beta':
default: $sRepoFile = 'beta.repository.json';
$sRepoFile = 'repository.json'; break;
break; case 'stable':
default:
$sRepoFile = 'repository.json';
break;
}
} }
$oHttp = \MailSo\Base\Http::SingletonInstance(); $oHttp = \MailSo\Base\Http::SingletonInstance();
@ -2352,8 +2361,9 @@ class Actions
$sAddRepo = $this->rainloopRepo(true); $sAddRepo = $this->rainloopRepo(true);
if (0 < \strlen($sAddRepo)) if (0 < \strlen($sAddRepo))
{ {
$aAddData = $this->getRepositoryDataByUrl($sAddRepo); $bFakeReal = false;
if (\is_array($aAddData) && 0 < \count($aAddData)) $aAddData = $this->getRepositoryDataByUrl($sAddRepo, $bFakeReal, false);
if ($bFakeReal && \is_array($aAddData) && 0 < \count($aAddData))
{ {
$aResult = \array_merge($aResult, $aAddData); $aResult = \array_merge($aResult, $aAddData);
} }