[Cs-content-commits] SF.net SVN: cs-content:[395] trunk/1.0
PHP Templating & Includes System
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-06-17 15:19:04
|
Revision: 395 http://cs-content.svn.sourceforge.net/cs-content/?rev=395&view=rev Author: crazedsanity Date: 2009-06-17 15:19:02 +0000 (Wed, 17 Jun 2009) Log Message: ----------- Minor changes to pgsql layer for compatibility with mysql layer. NOTE::: the main cs_phpDB class should have an abstract class or interface that defines all methods, etc that are required to work with it, so there is an easy-to-identify standard list of method names. /cs_phpDB.class.php: * get_dbtype() [NEW]: -- returns internal private $dbType /db_types/cs_phpDB__pgsql.class.php: * lastID() [NEW]: -- for compatibility with mysql calls (except this requires the sequence name; without some fancy SQL to retrieve the given sequence, any code attempting to use this will have to be coded around PostgreSQL so it knows the sequence name, or will have to build its schema so the sequence name is known and ALWAYS pass it). Modified Paths: -------------- trunk/1.0/cs_phpDB.class.php trunk/1.0/db_types/cs_phpDB__pgsql.class.php Modified: trunk/1.0/cs_phpDB.class.php =================================================================== --- trunk/1.0/cs_phpDB.class.php 2009-06-12 13:52:39 UTC (rev 394) +++ trunk/1.0/cs_phpDB.class.php 2009-06-17 15:19:02 UTC (rev 395) @@ -69,6 +69,14 @@ }//end __call() //========================================================================= + + + //========================================================================= + public function get_dbtype() { + return($this->dbType); + }//end get_dbtype() + //========================================================================= + } // end class phpDB ?> Modified: trunk/1.0/db_types/cs_phpDB__pgsql.class.php =================================================================== --- trunk/1.0/db_types/cs_phpDB__pgsql.class.php 2009-06-12 13:52:39 UTC (rev 394) +++ trunk/1.0/db_types/cs_phpDB__pgsql.class.php 2009-06-17 15:19:02 UTC (rev 395) @@ -1115,6 +1115,22 @@ + //========================================================================= + public function lastID($sequence) { + + if(strlen($sequence)) { + $retval = $this->get_currval($sequence); + } + else { + throw new exception(__METHOD__ .": no sequence specified (required by ". $this->dbType .")"); + } + + return($retval); + }//end lastID() + //========================================================================= + + + } // end class phpDB ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |