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

[email protected] 14 Jul 2005 23:41:20 -0000
Newsgroups gmane.comp.php.cowiki.cvs
Message-ID <[email protected]>
User: dgorski 
Date: 2005/07/14 16:41:20

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

Log:
 Disarm InnoDB check if user has decided to use MyISAM instead

File Changes:

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

File [changed]: class.TaskDocumentStorageConnector.php
Url: http://cowiki.tigris.org/source/browse/cowiki/htdocs/setup/class/task/class.TaskDocumentStorageConnector.php?r1=1.8&r2=1.9
Delta lines:  +23 -15
---------------------
--- class.TaskDocumentStorageConnector.php	26 May 2005 23:24:45 -0000	1.8
+++ class.TaskDocumentStorageConnector.php	14 Jul 2005 23:41:17 -0000	1.9
@@ -2,7 +2,7 @@
 
 /**
  *
- * $Id: class.TaskDocumentStorageConnector.php,v 1.8 2005/05/26 23:24:45 dgorski Exp $
+ * $Id: class.TaskDocumentStorageConnector.php,v 1.9 2005/07/14 23:41:17 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.8 $
+ * @version     $Revision: 1.9 $
  *
  */
 
@@ -276,8 +276,9 @@
                             ? $this->State->getDocumentStorageRootDSN()
                             : $this->State->getDocumentStorageDSN();
 
-            $Storage = StorageFactory::getInstance()
-                          ->create(new UriInfo($sResource));
+            $UriInfo = new UriInfo($sResource);
+
+            $Storage = StorageFactory::getInstance()->create($UriInfo);
 
         // Do we have basically the capability to access this database?
         } catch (StorageApiException $sae) {
@@ -311,7 +312,8 @@
                     'You have chosen to use an existing database
                     \''.$this->State->getDocDatabaseName().'\', but it
                     isn\'t there - or is not accessible with the given
-                    connector user.'
+                    connector user. Go back and choose to create a new
+                    document database.'
                 );
             }
         }
@@ -359,8 +361,13 @@
             );
         }
 
-        // Check if we have InnoDB (for MySQL only of course)
+        // Check if we have InnoDB (for MySQL only of course).
         if (substr(strtolower($sName), 0, 5) == 'mysql') {
+        
+            // We warn only if the user has chosen InnoDB. We do not warn
+            // if user selected MyISAM.
+            if (substr(strtolower($UriInfo->get('scheme')), -6) == 'innodb') {
+
             $aData = $Storage->fetchRowAndFreeResult(
                 $Storage->query('SHOW VARIABLES LIKE "HAVE_INNODB"')
             );
@@ -371,6 +378,7 @@
                      the InnoDB storage layer facility. Update or
                      reconfigure the MySQL database.'
                 );
+                }
             }
         }