Update of /cvsroot/phpweather/phpweather/db
In directory sc8-pr-cvs1:/tmp/cvs-serv4344/db
Modified Files:
pw_db_dba.php
Log Message:
This should load the DBA extension on systems that doesn't do this by
default.
Index: pw_db_dba.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/db/pw_db_dba.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- pw_db_dba.php 28 Aug 2002 10:05:55 -0000 1.9
+++ pw_db_dba.php 2 Sep 2003 17:59:44 -0000 1.10
@@ -38,18 +38,24 @@
var $link_countries_id;
/**
- * Constructor.
- *
- * It just calls the parent constructor.
+ * This constructor makes sure that the DBA extension is loaded and
+ * then calls the parent constructor.
*
* @param array the initial properties of the object
*/
function pw_db_dba($input) {
- /* We just call the parent constructor. */
+ /* We have to load the DBA extension on some systems: */
+ if (!extension_loaded('dba')) {
+ if (ereg('win', PHP_OS)) {
+ dl('php_dba.dll');
+ } else {
+ dl('dba.so');
+ }
+ }
$this->pw_db_common($input);
}
- /**
+ /**
* Gets the type of the database.
*
* @return string The type of the database, 'dba' in this case.
@@ -59,7 +65,7 @@
return 'dba';
}
- /**
+ /**
* Establishes a connection to the database. It is assumed, that the
* database is already created.
*
|