Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-07-06 19:05:38 +0400
committerArthur Schiwon <blizzz@owncloud.com>2013-07-12 19:45:36 +0400
commitbd7d04cb44ddd1a344d3e57ad8d80ec3f334f738 (patch)
tree4072955f6d71954819cc8f97a15a4843b7c191f7 /lib/updater.php
parenta9470181d5d5ca0a18f4b0cec486b58832bab252 (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.php10
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(