[FEATURE] Add check for loaded DBAL to requirements check
authorBastian Waidelich <bastian@typo3.org>
Sat, 9 Jul 2011 13:16:47 +0000 (15:16 +0200)
committerBastian Waidelich <bastian@typo3.org>
Sat, 9 Jul 2011 13:16:47 +0000 (15:16 +0200)
This adds a status report to ExtbaseRequirementsCheck that will
inform the user if the dbal Extension is installed.

Besides this slightly modifies the existing doc commend check
so it uses the new Bootstrap instead of the deprecated
Dispatcher

Change-Id: I5fed623316b955853c7dabeca716ebc5be490952

typo3/sysext/extbase/Classes/Utility/ExtbaseRequirementsCheck.php

index ec2ac19..7b3879e 100644 (file)
@@ -42,7 +42,8 @@ class Tx_Extbase_Utility_ExtbaseRequirementsCheck implements tx_reports_StatusPr
         */
        public function getStatus() {
                $reports = array(
-                       'docCommentsShouldBePreserved' => $this->checkIfDocCommentsArePreserved()
+                       'docCommentsShouldBePreserved' => $this->checkIfDocCommentsArePreserved(),
+                       'dbalExtensionIsInstalled' => $this->checkIfDbalExtensionIsInstalled()
                );
 
                return $reports;
@@ -51,11 +52,11 @@ class Tx_Extbase_Utility_ExtbaseRequirementsCheck implements tx_reports_StatusPr
        /**
         * Check whether doc comments are preserved or stipped off PHP by PHP accelerators.
         *
-        * @return      tx_reports_reports_status_Status
+        * @return tx_reports_reports_status_Status
         */
        protected function checkIfDocCommentsArePreserved() {
 
-               $method = new ReflectionMethod('Tx_Extbase_MVC_Dispatcher', 'dispatch');
+               $method = new ReflectionMethod('Tx_Extbase_Core_Bootstrap', 'run');
 
                if(strlen($method->getDocComment()) > 0) {
                        $value = 'Preserved';
@@ -73,5 +74,28 @@ class Tx_Extbase_Utility_ExtbaseRequirementsCheck implements tx_reports_StatusPr
                        $status
                );
        }
+
+       /**
+        * Check whether dbal extension is installed
+        *
+        * @return tx_reports_reports_status_Status
+        */
+       protected function checkIfDbalExtensionIsInstalled() {
+               if (t3lib_extMgm::isLoaded('dbal')) {
+                       $value = 'DBAL is loaded';
+                       $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.';
+                       $status = tx_reports_reports_status_Status::INFO;
+               } else {
+                       $value = 'DBAL is not loaded';
+                       $message = '';
+                       $status = tx_reports_reports_status_Status::OK;
+               }
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
+                       'DBAL Extension',
+                       $value,
+                       $message,
+                       $status
+               );
+       }
 }
 ?>
\ No newline at end of file