Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv23055
Modified Files:
db_layer.php
Log Message:
A new database backend: ADOdb. This is a wrapper library written in
PHP that supports no less than 28(!) databases. So now there's no
excuse for not using a database with PHP Weather.
Index: db_layer.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/db_layer.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- db_layer.php 15 May 2002 22:23:26 -0000 1.13
+++ db_layer.php 10 Nov 2002 23:15:40 -0000 1.14
@@ -1,10 +1,6 @@
<?php
require_once(PHPWEATHER_BASE_DIR . '/base_object.php');
-require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_null.php');
-require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_dba.php');
-require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_mysql.php');
-require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_pgsql.php');
/**
* This class is used to maintain the database-object.
@@ -49,18 +45,27 @@
*/
function set_db_type($type) {
$this->properties['db_type'] = $type;
+
switch ($type) {
case 'null':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_null.php');
$this->db = new pw_db_null($this->properties);
break;
case 'mysql':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_mysql.php');
$this->db = new pw_db_mysql($this->properties);
break;
case 'pgsql':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_pgsql.php');
$this->db = new pw_db_pgsql($this->properties);
break;
case 'dba':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_dba.php');
$this->db = new pw_db_dba($this->properties);
+ break;
+ case 'adodb':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_adodb.php');
+ $this->db = new pw_db_adodb($this->properties);
break;
default:
$this->error('db_type not recognized: <code>' .
|