[TASK] Re-work/simplify copyright header in PHP files - Part 8
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Utility / ExtbaseRequirementsCheckUtility.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Utility;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * A checker which hooks into the backend module "Reports" checking whether
19 * dbal is installed
20 */
21 class ExtbaseRequirementsCheckUtility implements \TYPO3\CMS\Reports\StatusProviderInterface {
22
23 /**
24 * Compiles a collection of system status checks as a status report.
25 *
26 * @return array
27 */
28 public function getStatus() {
29 $reports = array(
30 'dbalExtensionIsInstalled' => $this->checkIfDbalExtensionIsInstalled()
31 );
32 return $reports;
33 }
34
35 /**
36 * Check whether dbal extension is installed
37 *
38 * @return \TYPO3\CMS\Reports\Status
39 */
40 protected function checkIfDbalExtensionIsInstalled() {
41 if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal')) {
42 $value = 'DBAL is loaded';
43 $message = 'The Database Abstraction Layer Extension (dbal) is loaded. Extbase does not fully support dbal at the moment. If you are aware of this fact or don\'t make use of the incompatible parts on this installation, you can ignore this notice.';
44 $status = \TYPO3\CMS\Reports\Status::INFO;
45 } else {
46 $value = 'DBAL is not loaded';
47 $message = '';
48 $status = \TYPO3\CMS\Reports\Status::OK;
49 }
50 return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Reports\\Status', 'DBAL Extension', $value, $message, $status);
51 }
52 }