Revision: 194
http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=194&view=rev
Author: crazedsanity
Date: 2011-01-26 04:33:58 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
Add method to load database schema, remove unnecessary calls from constructor.
Modified Paths:
--------------
trunk/0.4/abstract/cs_webapplibs.abstract.class.php
Modified: trunk/0.4/abstract/cs_webapplibs.abstract.class.php
===================================================================
--- trunk/0.4/abstract/cs_webapplibs.abstract.class.php 2011-01-26 04:25:41 UTC (rev 193)
+++ trunk/0.4/abstract/cs_webapplibs.abstract.class.php 2011-01-26 04:33:58 UTC (rev 194)
@@ -15,10 +15,8 @@
protected $gfObj;
//-------------------------------------------------------------------------
- function __construct($makeGfObj=true) {
+ public function __construct($makeGfObj=true) {
$this->set_version_file_location(dirname(__FILE__) . '/../VERSION');
- $this->get_version();
- $this->get_project();
if($makeGfObj === true) {
//make a cs_globalFunctions{} object.
@@ -27,6 +25,21 @@
}
}//end __construct()
//-------------------------------------------------------------------------
+
+
+
+ //-------------------------------------------------------------------------
+ public function load_schema($dbType, cs_phpDb $db) {
+ $file = dirname(__FILE__) .'/../setup/schema.'. $dbType .'.sql';
+ try {
+ $result = $db->run_sql_file($file);
+ }
+ catch(Exception $e) {
+ throw new exception(__METHOD__ .": failed to load schema file (". $file ."), DETAILS::: ". $e->getMessage());
+ }
+ return($result);
+ }//end load_schema()
+ //-------------------------------------------------------------------------
}
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|