remove legacy class OC_Updater

This commit is contained in:
Thomas Müller 2014-10-17 11:42:10 +02:00
parent 8da6e4b9f0
commit 6af0e76a03
3 changed files with 6 additions and 21 deletions

View File

@ -1,19 +0,0 @@
<?php
/**
* Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
/**
* provides an interface to all search providers
*
* @deprecated use \OC\Updater instead
*/
class OC_Updater {
public static function check() {
$updater = new \OC\Updater();
return $updater->check('http://apps.owncloud.com/updater.php');
}
}

View File

@ -46,7 +46,7 @@ class OC_TemplateLayout extends OC_Template {
if($this->config->getSystemValue('updatechecker', true) === true &&
OC_User::isAdminUser(OC_User::getUser())) {
$updater = new \OC\Updater();
$data = $updater->check('http://apps.owncloud.com/updater.php');
$data = $updater->check();
if(isset($data['version']) && $data['version'] != '' and $data['version'] !== Array()) {
$this->assign('updateAvailable', true);

View File

@ -66,13 +66,17 @@ class Updater extends BasicEmitter {
* @param string $updaterUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
* @return array|bool
*/
public function check($updaterUrl) {
public function check($updaterUrl = null) {
// Look up the cache - it is invalidated all 30 minutes
if ((\OC_Appconfig::getValue('core', 'lastupdatedat') + 1800) > time()) {
return json_decode(\OC_Appconfig::getValue('core', 'lastupdateResult'), true);
}
if (is_null($updaterUrl)) {
$updaterUrl = 'https://apps.owncloud.com/updater.php';
}
\OC_Appconfig::setValue('core', 'lastupdatedat', time());
if (\OC_Appconfig::getValue('core', 'installedat', '') == '') {