Passed
Push — master ( 866282...d7d28b )
by Roeland
11:29 queued 10s
created

App::checkAppEnabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 *
5
 * @author Bart Visscher <[email protected]>
6
 * @author Frank Karlitschek <[email protected]>
7
 * @author Georg Ehrke <[email protected]>
8
 * @author Joas Schilling <[email protected]>
9
 * @author Jörn Friedrich Dreyer <[email protected]>
10
 * @author Morris Jobke <[email protected]>
11
 * @author Robin McCorkell <[email protected]>
12
 * @author Thomas Müller <[email protected]>
13
 *
14
 * @license AGPL-3.0
15
 *
16
 * This code is free software: you can redistribute it and/or modify
17
 * it under the terms of the GNU Affero General Public License, version 3,
18
 * as published by the Free Software Foundation.
19
 *
20
 * This program is distributed in the hope that it will be useful,
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
 * GNU Affero General Public License for more details.
24
 *
25
 * You should have received a copy of the GNU Affero General Public License, version 3,
26
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
27
 *
28
 */
29
30
/**
31
 * Public interface of ownCloud for apps to use.
32
 * App Class
33
 *
34
 */
35
36
// use OCP namespace for all classes that are considered public.
37
// This means that they should be used by apps instead of the internal ownCloud classes
38
namespace OCP;
39
40
/**
41
 * This class provides functions to manage apps in ownCloud
42
 * @since 4.0.0
43
 * @deprecated 14.0.0
44
 */
45
class App {
46
47
48
	/**
49
	 * Register a Configuration Screen that should appear in the personal settings section.
50
	 * @param string $app appid
51
	 * @param string $page page to be included
52
	 * @return void
53
	 * @since 4.0.0
54
	 * @deprecated 14.0.0 Use settings section in appinfo.xml to register personal admin sections
55
	*/
56
	public static function registerPersonal( $app, $page ) {
57
		\OC_App::registerPersonal( $app, $page );
58
	}
59
60
	/**
61
	 * Register a Configuration Screen that should appear in the Admin section.
62
	 * @param string $app string appid
63
	 * @param string $page string page to be included
64
	 * @return void
65
	 * @since 4.0.0
66
	 * @deprecated 14.0.0 Use settings section in appinfo.xml to register admin sections
67
	 */
68
	public static function registerAdmin( $app, $page ) {
69
		\OC_App::registerAdmin( $app, $page );
70
	}
71
72
	/**
73
	 * Read app metadata from the info.xml file
74
	 * @param string $app id of the app or the path of the info.xml file
75
	 * @param boolean $path (optional)
76
	 * @return array|null
77
	 * @deprecated 14.0.0 ise \OC::$server->getAppManager()->getAppInfo($appId)
78
	 * @since 4.0.0
79
	*/
80
	public static function getAppInfo( $app, $path=false ) {
81
		return \OC_App::getAppInfo( $app, $path);
0 ignored issues
show
Deprecated Code introduced by
The function OC_App::getAppInfo() has been deprecated: 14.0.0 use \OC::$server->getAppManager()->getAppInfo() ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

81
		return /** @scrutinizer ignore-deprecated */ \OC_App::getAppInfo( $app, $path);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
82
	}
83
84
	/**
85
	 * checks whether or not an app is enabled
86
	 * @param string $app
87
	 * @return boolean
88
	 *
89
	 * This function checks whether or not an app is enabled.
90
	 * @since 4.0.0
91
	 * @deprecated 13.0.0 use \OC::$server->getAppManager()->isEnabledForUser($appId)
92
	 */
93
	public static function isEnabled( $app ) {
94
		return \OC::$server->getAppManager()->isEnabledForUser( $app );
95
	}
96
97
	/**
98
	 * Get the last version of the app from appinfo/info.xml
99
	 * @param string $app
100
	 * @return string
101
	 * @since 4.0.0
102
	 * @deprecated 14.0.0 use \OC::$server->getAppManager()->getAppVersion($appId)
103
	 */
104
	public static function getAppVersion( $app ) {
105
		return \OC::$server->getAppManager()->getAppVersion($app);
106
	}
107
}
108