Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
| ApplicationHelper | |
0.00% |
0 / 4 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
| isDemo | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getVersionName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getProductName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPlatformVersion | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2018 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\tao\helpers; |
| 23 | |
| 24 | use oat\oatbox\service\ServiceManager; |
| 25 | use oat\tao\model\service\ApplicationService; |
| 26 | |
| 27 | /** |
| 28 | * Class ApplicationHelper |
| 29 | * @package oat\tao\helpers |
| 30 | * |
| 31 | * @deprecated Use oat\tao\model\service\ApplicationService instead |
| 32 | */ |
| 33 | class ApplicationHelper |
| 34 | { |
| 35 | /** |
| 36 | * Returns a whenever or not the current instance is used as demo instance |
| 37 | * |
| 38 | * @return boolean |
| 39 | */ |
| 40 | public static function isDemo() |
| 41 | { |
| 42 | return ServiceManager::getServiceManager()->get(ApplicationService::SERVICE_ID)->isDemo(); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * @return string |
| 47 | */ |
| 48 | public static function getVersionName() |
| 49 | { |
| 50 | return ServiceManager::getServiceManager()->get(ApplicationService::SERVICE_ID)->getVersionName(); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * @return string |
| 55 | * @throws \common_exception_Error |
| 56 | * @throws \common_ext_ExtensionException |
| 57 | */ |
| 58 | public function getProductName() |
| 59 | { |
| 60 | return ServiceManager::getServiceManager()->get(ApplicationService::SERVICE_ID)->getProductName(); |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * @return string |
| 65 | * @throws \common_exception_Error |
| 66 | * @throws \common_ext_ExtensionException |
| 67 | */ |
| 68 | public function getPlatformVersion() |
| 69 | { |
| 70 | return ServiceManager::getServiceManager()->get(ApplicationService::SERVICE_ID)->getPlatformVersion(); |
| 71 | } |
| 72 | } |