app.php
1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* ownCloud - Updater plugin
*
* @author Victor Dubiniuk
* @copyright 2012-2013 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 = \OC_L10N::get(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
\OC_APP::registerAdmin(self::APP_ID, 'admin');
}
/**
* Get app working directory
* @return string
*/
public static function getBackupBase() {
return \OC_Config::getValue("datadirectory", \OC::$SERVERROOT . "/data") . '/updater_backup/';
}
public static function getLegacyBackupBase() {
return \OC::$SERVERROOT . '/backup/';
}
public static function log($message, $level= \OC_Log::ERROR) {
\OC_Log::write(self::APP_ID, $message, $level);
}
}
//Startup
if (\OCP\App::isEnabled(App::APP_ID)) {
App::init();
}