CVS update: /cowiki/htdocs/setup/class/task/

[email protected] 7 May 2005 22:08:11 -0000
Newsgroups gmane.comp.php.cowiki.cvs
Message-ID <[email protected]>
User: dgorski 
Date: 2005/05/07 15:08:11

Modified:
   cowiki/htdocs/setup/class/task/class.TaskDocumentStorageMySQLInformer.php

Log:
 Check if the application is set up to use MySQL MyISAM tables for _document_ storage

File Changes:

Directory: /cowiki/htdocs/setup/class/task/
===========================================

File [changed]: class.TaskDocumentStorageMySQLInformer.php
Url: http://cowiki.tigris.org/source/browse/cowiki/htdocs/setup/class/task/class.TaskDocumentStorageMySQLInformer.php?r1=1.1&r2=1.2
Delta lines:  +23 -3
--------------------
--- class.TaskDocumentStorageMySQLInformer.php	6 May 2005 21:44:40 -0000	1.1
+++ class.TaskDocumentStorageMySQLInformer.php	7 May 2005 22:08:09 -0000	1.2
@@ -2,7 +2,7 @@
 
 /**
  *
- * $Id: class.TaskDocumentStorageMySQLInformer.php,v 1.1 2005/05/06 21:44:40 dgorski Exp $
+ * $Id: class.TaskDocumentStorageMySQLInformer.php,v 1.2 2005/05/07 22:08:09 dgorski Exp $
  *
  * This file is part of coWiki. coWiki is free software under the terms of
  * the GNU General Public License (GPL). Read the LICENSE file. If you did
@@ -17,7 +17,7 @@
  * @author      Daniel T. Gorski, <[email protected]>
  * @copyright   (C) Daniel T. Gorski, {@link http://www.develnet.org}
  * @license     http://www.gnu.org/licenses/gpl.html
- * @version     $Revision: 1.1 $
+ * @version     $Revision: 1.2 $
  *
  */
 
@@ -40,12 +40,32 @@
     public function __construct($Tpl) {
         parent::__construct($Tpl);
         parent::checkValidUser();
+        parent::loadClassLoader();
     }
 
     // --------------------------------------------------------------------
 
     public function isRequired() {
+
+        // Load application configuration
+        $Conf = $this->getConfig();
+
+        // Check if the application is set up to use MySQL MyISAM tables
+        // for _document_ storage
+        $UriInfo = new UriInfo(
+                      $Conf->getSectionKeyValue(
+                        '.DOCUMENT', 'RESOURCE'
+                      )
+                   );
+
+        if ($UriInfo->get('scheme') == 'mysql'
+            || $UriInfo->get('scheme') == 'mysqli') {
+
+            // Show this informer (display/render if it "is required")
         return true;
+        }
+
+        return false;
     }
 
     // --------------------------------------------------------------------