Total Complexity | 4 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
15 | class AppInfo { |
||
16 | |||
17 | public const APP_ID = 'music'; |
||
18 | |||
19 | public static function getVersion() : string { |
||
20 | // Nextcloud 14 introduced a new API for this which is not available on ownCloud. |
||
21 | // Nextcloud 25 removed the old API for good. |
||
22 | $appManager = \OC::$server->getAppManager(); |
||
23 | if (\method_exists($appManager, 'getAppVersion')) { |
||
24 | return $appManager->getAppVersion(self::APP_ID); // NC14+ |
||
25 | } else { |
||
26 | return \OCP\App::getAppVersion(self::APP_ID); // OC or NC13 |
||
|
|||
27 | } |
||
28 | } |
||
29 | |||
30 | public static function getVendor() : string { |
||
31 | $vendor = 'owncloud/nextcloud'; // this should get overridden by the next 'include' |
||
32 | include \OC::$SERVERROOT . '/version.php'; |
||
33 | return $vendor; |
||
34 | } |
||
35 | |||
36 | public static function getFullName() : string { |
||
38 | } |
||
39 | } |
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.