Skip to content
Snippets Groups Projects
Commit 9cd7ecd5 authored by Robin Appelman's avatar Robin Appelman
Browse files

Updater: pass update url as argument to update check

parent 58f473d7
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,6 @@
class OC_Updater {
public static function check() {
$updater = new \OC\Updater();
return $updater->check();
return $updater->check('http://apps.owncloud.com/updater.php');
}
}
......@@ -37,9 +37,10 @@ class Updater extends BasicEmitter {
/**
* Check if a new version is available
* @param string $updateUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
* @return array | bool
*/
public function check() {
public function check($updaterUrl) {
// Look up the cache - it is invalidated all 30 minutes
if ((\OC_Appconfig::getValue('core', 'lastupdatedat') + 1800) > time()) {
......@@ -51,17 +52,16 @@ class Updater extends BasicEmitter {
if (\OC_Appconfig::getValue('core', 'installedat', '') == '') {
\OC_Appconfig::setValue('core', 'installedat', microtime(true));
}
$updaterurl = 'http://apps.owncloud.com/updater.php';
;
$version = \OC_Util::getVersion();
$version['installed'] = \OC_Appconfig::getValue('core', 'installedat');
$version['updated'] = \OC_Appconfig::getValue('core', 'lastupdatedat');
$version['updatechannel'] = 'stable';
$version['edition'] = \OC_Util::getEditionString();
$versionstring = implode('x', $version);
$versionString = implode('x', $version);
//fetch xml data from updater
$url = $updaterurl . '?version=' . $versionstring;
$url = $updaterUrl . '?version=' . $versionString;
// set a sensible timeout of 10 sec to stay responsive even if the update server is down.
$ctx = stream_context_create(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment