[Cs-content-commits] SF.net SVN: cs-content:[336] trunk/1.0
PHP Templating & Includes System
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-01-29 22:49:43
|
Revision: 336 http://cs-content.svn.sourceforge.net/cs-content/?rev=336&view=rev Author: crazedsanity Date: 2009-01-29 21:45:51 +0000 (Thu, 29 Jan 2009) Log Message: ----------- Renamed cs_phpDB.php to cs_phpDB.class.php. /cs_phpDB.class.php [RENAMED FROM cs_phpDB.php] /cs_phpDB.php [RENAMED TO cs_phpDB.class.php] Added Paths: ----------- trunk/1.0/cs_phpDB.class.php Removed Paths: ------------- trunk/1.0/cs_phpDB.php Copied: trunk/1.0/cs_phpDB.class.php (from rev 333, trunk/1.0/cs_phpDB.php) =================================================================== --- trunk/1.0/cs_phpDB.class.php (rev 0) +++ trunk/1.0/cs_phpDB.class.php 2009-01-29 21:45:51 UTC (rev 336) @@ -0,0 +1,74 @@ +<?php + +/* + * A class for generic PostgreSQL database access. + * + * SVN INFORMATION::: + * SVN Signature:::::::: $Id$ + * Last Committted Date: $Date$ + * Last Committed Path:: $HeadURL$ + * + */ + +/////////////////////// +// ORIGINATION INFO: +// Author: Trevin Chow (with contributions from Lee Pang, wle...@ho...) +// Email: t1...@ma... +// Date: February 21, 2000 +// Last Updated: August 14, 2001 +// +// Description: +// Abstracts both the php function calls and the server information to POSTGRES +// databases. Utilizes class variables to maintain connection information such +// as number of rows, result id of last operation, etc. +// +/////////////////////// + +require_once(dirname(__FILE__) ."/abstract/cs_content.abstract.class.php"); +require_once(dirname(__FILE__) ."/abstract/cs_phpDB.abstract.class.php"); + +class cs_phpDB extends cs_contentAbstract { + + private $dbLayerObj; + private $dbType; + + //========================================================================= + public function __construct($type='pgsql') { + + if(strlen($type)) { + + require_once(dirname(__FILE__) .'/db_types/'. __CLASS__ .'__'. $type .'.class.php'); + $className = __CLASS__ .'__'. $type; + $this->dbLayerObj = new $className; + $this->dbType = $type; + + parent::__construct(); + + $this->isInitialized = TRUE; + } + else { + throw new exception(__METHOD__ .": failed to give a type (". $type .")"); + } + }//end __construct() + //========================================================================= + + + + //========================================================================= + /** + * Magic method to call methods within the database abstraction layer ($this->dbLayerObj). + */ + public function __call($methodName, $args) { + if(method_exists($this->dbLayerObj, $methodName)) { + $retval = call_user_func_array(array($this->dbLayerObj, $methodName), $args); + } + else { + throw new exception(__METHOD__ .': unsupported method ('. $methodName .') for database of type ('. $this->dbType .')'); + } + return($retval); + }//end __call() + //========================================================================= + +} // end class phpDB + +?> Property changes on: trunk/1.0/cs_phpDB.class.php ___________________________________________________________________ Added: svn:eol + native Added: svn:keywords + Id HeadURL Date Revision Author Added: svn:mergeinfo + Added: svn:eol-style + native Deleted: trunk/1.0/cs_phpDB.php =================================================================== --- trunk/1.0/cs_phpDB.php 2009-01-29 21:25:58 UTC (rev 335) +++ trunk/1.0/cs_phpDB.php 2009-01-29 21:45:51 UTC (rev 336) @@ -1,74 +0,0 @@ -<?php - -/* - * A class for generic PostgreSQL database access. - * - * SVN INFORMATION::: - * SVN Signature:::::::: $Id$ - * Last Committted Date: $Date$ - * Last Committed Path:: $HeadURL$ - * - */ - -/////////////////////// -// ORIGINATION INFO: -// Author: Trevin Chow (with contributions from Lee Pang, wle...@ho...) -// Email: t1...@ma... -// Date: February 21, 2000 -// Last Updated: August 14, 2001 -// -// Description: -// Abstracts both the php function calls and the server information to POSTGRES -// databases. Utilizes class variables to maintain connection information such -// as number of rows, result id of last operation, etc. -// -/////////////////////// - -require_once(dirname(__FILE__) ."/abstract/cs_content.abstract.class.php"); -require_once(dirname(__FILE__) ."/abstract/cs_phpDB.abstract.class.php"); - -class cs_phpDB extends cs_contentAbstract { - - private $dbLayerObj; - private $dbType; - - //========================================================================= - public function __construct($type='pgsql') { - - if(strlen($type)) { - - require_once(dirname(__FILE__) .'/db_types/'. __CLASS__ .'__'. $type .'.class.php'); - $className = __CLASS__ .'__'. $type; - $this->dbLayerObj = new $className; - $this->dbType = $type; - - parent::__construct(); - - $this->isInitialized = TRUE; - } - else { - throw new exception(__METHOD__ .": failed to give a type (". $type .")"); - } - }//end __construct() - //========================================================================= - - - - //========================================================================= - /** - * Magic method to call methods within the database abstraction layer ($this->dbLayerObj). - */ - public function __call($methodName, $args) { - if(method_exists($this->dbLayerObj, $methodName)) { - $retval = call_user_func_array(array($this->dbLayerObj, $methodName), $args); - } - else { - throw new exception(__METHOD__ .': unsupported method ('. $methodName .') for database of type ('. $this->dbType .')'); - } - return($retval); - }//end __call() - //========================================================================= - -} // end class phpDB - -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |