From: <cw...@us...> - 2007-10-09 15:54:29
|
Revision: 542 http://rdfapi-php.svn.sourceforge.net/rdfapi-php/?rev=542&view=rev Author: cweiske Date: 2007-10-09 08:54:27 -0700 (Tue, 09 Oct 2007) Log Message: ----------- Tell explicitely that the driver type is wrong Modified Paths: -------------- trunk/rdfapi-php/api/model/DbStore.php trunk/rdfapi-php/test/setup.php Modified: trunk/rdfapi-php/api/model/DbStore.php =================================================================== --- trunk/rdfapi-php/api/model/DbStore.php 2007-10-09 15:48:01 UTC (rev 541) +++ trunk/rdfapi-php/api/model/DbStore.php 2007-10-09 15:54:27 UTC (rev 542) @@ -309,7 +309,7 @@ public function createTables($databaseType = null) { $driver = $this->getDriver($databaseType); - $this->assertDriverSupported($driver); + self::assertDriverSupported($driver); $createFunc = '_createTables_' . $driver; return $this->$createFunc(); @@ -519,7 +519,7 @@ public function isSetup($databaseType = null) { $driver = $this->getDriver($databaseType); - $this->assertDriverSupported($driver); + self::assertDriverSupported($driver); $issetupFunc = '_isSetup_' . $driver; return $this->$issetupFunc(); @@ -559,7 +559,7 @@ * * @throws Exception If the driver is not supported */ - protected function assertDriverSupported($databaseType) + public static function assertDriverSupported($databaseType) { if (!in_array($databaseType, self::$arSupportedDbTypes)) { throw new Exception( @@ -568,7 +568,7 @@ ); } return true; - }//protected function assertDriverSupported($databaseType) + }//public static function assertDriverSupported($databaseType) Modified: trunk/rdfapi-php/test/setup.php =================================================================== --- trunk/rdfapi-php/test/setup.php 2007-10-09 15:48:01 UTC (rev 541) +++ trunk/rdfapi-php/test/setup.php 2007-10-09 15:54:27 UTC (rev 542) @@ -9,10 +9,19 @@ die('Please copy "test/config.php.dist" to "test/config.php" and adjust it'); } require_once $strConfFile; +require_once RDFAPI_INCLUDE_DIR . '/model/DbStore.php'; require_once RDFAPI_INCLUDE_DIR . '/model/ModelFactory.php'; +try { + DbStore::assertDriverSupported($GLOBALS['dbConf']['type']); +} catch (Exception $e) { + echo "Error: " . $e->getMessage() . "\n"; + echo "Be sure to write the driver type in the same cAsE\n"; + exit(4); +} + try { $database = ModelFactory::getDbStore( $GLOBALS['dbConf']['type'], $GLOBALS['dbConf']['host'], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |