[Cs-webapplibs-commits] SF.net SVN: cs-webapplibs:[131] trunk/0.3
Status: Beta
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-08-21 16:30:25
|
Revision: 131 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=131&view=rev Author: crazedsanity Date: 2009-08-21 16:30:05 +0000 (Fri, 21 Aug 2009) Log Message: ----------- Table prefix changes, optionally create new connection when reconnecting db. /cs_phpDB.class.php: * ARG CHANGE: NEW ARG: #1 ($forceNewConnection=TRUE) * optionally create a new connection (default is true) /cs_webdblogger.class.php: * fix table prefix from cswdbl to cswal. /cs_webdbupgrade.class.php: * load_table(): -- remove unnecessary str_replace() calls. /tests/testOfCSWebAppLibs.php: * remove_tables(): -- fix table prefixes -- add cswal_session_store_table as one that is dropped, since that is now in the main schema file. Modified Paths: -------------- trunk/0.3/cs_phpDB.class.php trunk/0.3/cs_webdblogger.class.php trunk/0.3/cs_webdbupgrade.class.php trunk/0.3/tests/testOfCSWebAppLibs.php Modified: trunk/0.3/cs_phpDB.class.php =================================================================== --- trunk/0.3/cs_phpDB.class.php 2009-08-21 16:16:22 UTC (rev 130) +++ trunk/0.3/cs_phpDB.class.php 2009-08-21 16:30:05 UTC (rev 131) @@ -182,9 +182,9 @@ //========================================================================= - public function reconnect() { + public function reconnect($forceNewConnection=TRUE) { if(is_array($this->connectParams) && count($this->connectParams)) { - $this->dbLayerObj->connect($this->connectParams, true); + $this->dbLayerObj->connect($this->connectParams, $forceNewConnection); } else { throw new exception(__METHOD__ .": no connection parameters stored"); Modified: trunk/0.3/cs_webdblogger.class.php =================================================================== --- trunk/0.3/cs_webdblogger.class.php 2009-08-21 16:16:22 UTC (rev 130) +++ trunk/0.3/cs_webdblogger.class.php 2009-08-21 16:30:05 UTC (rev 131) @@ -22,7 +22,7 @@ * * QUERY TO GET LAST COUPLE OF LOGS:::: SELECT l.log_id as id, l.creation, l.event_id as lid, le.description AS event, l.details - FROM cswdbl_log_table AS l INNER JOIN cswdbl_event_table AS le USING (event_id) ORDER BY log_id DESC LIMIT 25; + FROM cswal_log_table AS l INNER JOIN cswal_event_table AS le USING (event_id) ORDER BY log_id DESC LIMIT 25; */ //NOTE::: this class **REQUIRES** cs-content for its "cs_phpDB" class. @@ -64,22 +64,22 @@ /** List of tables keyed off an internal reference name. */ protected $tables = array( - 'category' => 'cswdbl_category_table', - 'class' => 'cswdbl_class_table', - 'event' => 'cswdbl_event_table', - 'log' => 'cswdbl_log_table', - 'attrib' => 'cswdbl_attribute_table', - 'logAttrib' => 'cswdbl_log_attribute_table' + 'category' => 'cswal_category_table', + 'class' => 'cswal_class_table', + 'event' => 'cswal_event_table', + 'log' => 'cswal_log_table', + 'attrib' => 'cswal_attribute_table', + 'logAttrib' => 'cswal_log_attribute_table' ); /** List of sequences keyed off an internal reference name (MUST match references above) */ protected $seqs = array( - 'category' => "cswdbl_category_table_category_id_seq", - 'class' => "cswdbl_class_table_class_id_seq", - 'event' => "cswdbl_event_table_event_id_seq", - 'log' => "cswdbl_log_table_log_id_seq", - 'attrib' => "cswdbl_attribute_table_attribute_id_seq", - 'logAttrib' => "cswdbl_log_attribute_table_log_attribute_id_seq" + 'category' => "cswal_category_table_category_id_seq", + 'class' => "cswal_class_table_class_id_seq", + 'event' => "cswal_event_table_event_id_seq", + 'log' => "cswal_log_table_log_id_seq", + 'attrib' => "cswal_attribute_table_attribute_id_seq", + 'logAttrib' => "cswal_log_attribute_table_log_attribute_id_seq" ); //========================================================================= Modified: trunk/0.3/cs_webdbupgrade.class.php =================================================================== --- trunk/0.3/cs_webdbupgrade.class.php 2009-08-21 16:16:22 UTC (rev 130) +++ trunk/0.3/cs_webdbupgrade.class.php 2009-08-21 16:30:05 UTC (rev 131) @@ -905,8 +905,6 @@ public function load_table() { $schemaFileLocation = dirname(__FILE__) .'/setup/schema.'. $this->db->get_dbtype() .'.sql'; $schema = file_get_contents($schemaFileLocation); - $schema = str_replace('{tableName}', $this->config['DB_TABLE'], $schema); - $schema = str_replace('{primaryKey}', $this->config['DB_PRIMARYKEY'], $schema); $this->db->exec($schema); $loadTableResult = $this->db->errorMsg(); Modified: trunk/0.3/tests/testOfCSWebAppLibs.php =================================================================== --- trunk/0.3/tests/testOfCSWebAppLibs.php 2009-08-21 16:16:22 UTC (rev 130) +++ trunk/0.3/tests/testOfCSWebAppLibs.php 2009-08-21 16:30:05 UTC (rev 131) @@ -44,9 +44,9 @@ //-------------------------------------------------------------------------- private function remove_tables() { $tableList = array( - 'cswal_auth_token_table', 'cswal_version_table', 'cswdbl_attribute_table', - 'cswdbl_category_table', 'cswdbl_class_table', 'cswdbl_event_table', - 'cswdbl_log_attribute_table', 'cswdbl_log_table', + 'cswal_auth_token_table', 'cswal_version_table', 'cswal_attribute_table', + 'cswal_category_table', 'cswal_class_table', 'cswal_event_table', + 'cswal_log_attribute_table', 'cswal_log_table', 'cswal_session_store_table' ); $db = $this->create_dbconn(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |