Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning when enabling the updater #4

Merged
merged 1 commit into from
May 14, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 2 additions & 44 deletions appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,7 @@

namespace OCA\Updater;

class App {

const APP_ID = 'updater';

public static $l10n;

public static function init() {
self::$l10n = \OCP\Util::getL10N(self::APP_ID);
\OC::$CLASSPATH['OCA\Updater\Backup'] = self::APP_ID . '/lib/backup.php';
\OC::$CLASSPATH['OCA\Updater\Downloader'] = self::APP_ID . '/lib/downloader.php';
\OC::$CLASSPATH['OCA\Updater\Updater'] = self::APP_ID . '/lib/updater.php';
\OC::$CLASSPATH['OCA\Updater\Helper'] = self::APP_ID . '/lib/helper.php';
\OC::$CLASSPATH['OCA\Updater\Location'] = self::APP_ID . '/lib/location.php';
\OC::$CLASSPATH['OCA\Updater\Location_3rdparty'] = self::APP_ID . '/lib/location/3rdparty.php';
\OC::$CLASSPATH['OCA\Updater\Location_Apps'] = self::APP_ID . '/lib/location/apps.php';
\OC::$CLASSPATH['OCA\Updater\Location_Core'] = self::APP_ID . '/lib/location/core.php';

//Allow config page
\OCP\App::registerAdmin(self::APP_ID, 'admin');
}
//Startup
App::init();

/**
* Get app working directory
* @return string
*/
public static function getBackupBase() {
return \OCP\Config::getSystemValue("datadirectory", \OC::$SERVERROOT . "/data") . '/updater_backup/';
}

public static function getLegacyBackupBase() {
return \OC::$SERVERROOT . '/backup/';
}

public static function getTempBase(){
return \OC::$SERVERROOT . "/_oc-upgrade/";
}

public static function log($message, $level= \OC_Log::ERROR) {
\OCP\Util::writeLog(self::APP_ID, $message, $level);
}
}

//Startup
if (\OCP\App::isEnabled(App::APP_ID)) {
App::init();
}
55 changes: 55 additions & 0 deletions lib/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

/**
* ownCloud - Updater plugin
*
* @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/

namespace OCA\Updater;

class App {

const APP_ID = 'updater';

public static $l10n;

public static function init() {
self::$l10n = \OCP\Util::getL10N(self::APP_ID);
\OC::$CLASSPATH['OCA\Updater\Backup'] = self::APP_ID . '/lib/backup.php';
\OC::$CLASSPATH['OCA\Updater\Downloader'] = self::APP_ID . '/lib/downloader.php';
\OC::$CLASSPATH['OCA\Updater\Updater'] = self::APP_ID . '/lib/updater.php';
\OC::$CLASSPATH['OCA\Updater\Helper'] = self::APP_ID . '/lib/helper.php';
\OC::$CLASSPATH['OCA\Updater\Location'] = self::APP_ID . '/lib/location.php';
\OC::$CLASSPATH['OCA\Updater\Location_3rdparty'] = self::APP_ID . '/lib/location/3rdparty.php';
\OC::$CLASSPATH['OCA\Updater\Location_Apps'] = self::APP_ID . '/lib/location/apps.php';
\OC::$CLASSPATH['OCA\Updater\Location_Core'] = self::APP_ID . '/lib/location/core.php';

//Allow config page
\OCP\App::registerAdmin(self::APP_ID, 'admin');
}

/**
* Get app working directory
* @return string
*/
public static function getBackupBase() {
return \OCP\Config::getSystemValue("datadirectory", \OC::$SERVERROOT . "/data") . '/updater_backup/';
}

public static function getLegacyBackupBase() {
return \OC::$SERVERROOT . '/backup/';
}

public static function getTempBase(){
return \OC::$SERVERROOT . "/_oc-upgrade/";
}

public static function log($message, $level= \OC_Log::ERROR) {
\OCP\Util::writeLog(self::APP_ID, $message, $level);
}
}