• Main Page
  • Data Structures
  • Files
  • File List

sqlite3Connection.php

Go to the documentation of this file.
00001 <?php
00002 
00003 /**
00004   * SQLite3 database connection class
00005   *
00006   * @package objSQL
00007   * @version 2.1.0
00008   * @author MT Jordan <mtjo62@gmail.com>
00009   * @link http://objsql.sourceforge.net
00010   * @copyright 2004-2010 openSource Partners
00011   * @license LGPL
00012   * @revision $Id: sqlite3Connection.php,v 1.0 2010-06-01 10:28:58-05 mt_jordan Exp $
00013   */
00014 
00015 class sqlite3Connection
00016 {
00017     /**********************************************
00018      * Internal variables
00019      *********************************************/
00020 
00021     /**
00022      * Database connection object
00023      *
00024      * @access private
00025      * @var mixed
00026      */
00027     private $objConnection;
00028 
00029     /**
00030      * Database connection information
00031      *
00032      * @access private
00033      * @var array
00034      */
00035     private $objDatasource;
00036     
00037     /**********************************************
00038      * Class methods
00039      *********************************************/
00040 
00041     /**
00042      * Constructor
00043      *
00044      * @access public
00045      * @param  array $datasource
00046      */
00047     public function __construct( $datasource )
00048     {
00049         $this->objDatasource = $datasource;
00050     }
00051 
00052     /**
00053      * Connect to database server
00054      *
00055      * @access public
00056      * @return mixed
00057      */
00058     public function objDbConnection()
00059     {
00060         $this->objConnection = new SQLite3( $this->objDatasource[4] );
00061         
00062         if ( !$this->objConnection )
00063             trigger_error( $this->objConnection->lastErrorMsg(), E_USER_WARNING );
00064 
00065         return $this->objConnection;
00066     }
00067 
00068     /**
00069      * Close connection to database server
00070      *
00071      * @access public
00072      * @return bool
00073      */
00074     public function objDbClose()
00075     {
00076         return $this->objConnection->close();
00077     }
00078 
00079     /**
00080      * Return info on database server
00081      *
00082      * @access public
00083      * @return array
00084      */
00085     public function objServerVersion()
00086     {
00087         $objVersion = $this->objConnection->version();
00088         
00089         return $objVersion['versionString'];
00090     }
00091 }
00092 
00093 ?>

Generated on Sat Jul 10 2010 15:14:39 for objSQL 2.1.0 by  doxygen 1.7.1