diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-07-06 19:05:38 +0400 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-07-12 19:45:36 +0400 |
commit | bd7d04cb44ddd1a344d3e57ad8d80ec3f334f738 (patch) | |
tree | 4072955f6d71954819cc8f97a15a4843b7c191f7 /lib/updater.php | |
parent | a9470181d5d5ca0a18f4b0cec486b58832bab252 (diff) |
backport: Updater: pass update url as argument to update check
Conflicts:
lib/updater.php
Diffstat (limited to 'lib/updater.php')
-rw-r--r-- | lib/updater.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/updater.php b/lib/updater.php index b0bc026167b..a167ac0ef04 100644 --- a/lib/updater.php +++ b/lib/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) { OC_Appconfig::setValue('core', 'lastupdatedat', microtime(true)); if ((\OC_Appconfig::getValue('core', 'lastupdatedat') + 1800) > time()) { return json_decode(\OC_Appconfig::getValue('core', 'lastupdateResult'), true); @@ -47,17 +48,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( |