// Database independent query interface.
//
-if (!empty($GLOBALS['USED_PACKAGES']['DB'])) return;
-$GLOBALS['USED_PACKAGES']['DB'] = true;
-
// {{{ Database independent error codes.
/*
* error
*/
function &factory($type) {
- global $USED_PACKAGES;
- // "include" should be replaced with "import" once PHP gets it
- $pkgname = 'DB/' . $type;
- if (!is_array($USED_PACKAGES) || !$USED_PACKAGES[$pkgname]) {
- if (!@include("${pkgname}.php")) {
- return DB_ERROR_NOT_FOUND;
- } else {
- $USED_PACKAGES[$pkgname] = true;
- }
+ if (!@import("DB/${type}.php")) {
+ return DB_ERROR_NOT_FOUND;
}
$classname = 'DB_' . $type;
$obj = new $classname;
$dsninfo = DB::parseDSN($dsn);
$type = $dsninfo['phptype'];
- // "include" should be replaced with "import" once PHP gets it
- $pkgname = 'DB/' . $type;
- if (!is_array($USED_PACKAGES) || !$USED_PACKAGES[$pkgname]) {
- $file = "${pkgname}.php";
- include($file);
-/*
-
- This suddenly stopped working. I thought include() was supposed to
- return a boolean? [ssb 20000218]
-
- if (!include($file)) {
- print "'$file' not found<br>\n";
- return DB_ERROR_NOT_FOUND;
- } else {
- $USED_PACKAGES[$pkgname] = true;
- }
-*/
+ if (!@import("DB/${type}.php")) {
+ return DB_ERROR_NOT_FOUND;
}
$classname = 'DB_' . $type;
$obj = new $classname;
* not recognized
*/
function errorMessage($code) {
- if (!is_array($errorMessages)) {
+ if (!isset($errorMessages)) {
$errorMessages = array(
DB_OK => "no error",
DB_ERROR => "unknown error",
$(INSTALL_DATA) $(srcdir)/DB/odbc.php $(pear_DBdir) && \
$(INSTALL_DATA) $(srcdir)/DB/mysql.php $(pear_DBdir) && \
$(INSTALL_DATA) $(srcdir)/DB/pgsql.php $(pear_DBdir) && \
- $(INSTALL_DATA) $(srcdir)/DB/storage.php $(pear_DBdir)
+ $(INSTALL_DATA) $(srcdir)/DB/storage.php $(pear_DBdir) && \
+ $(INSTALL_DATA) $(srcdir)/HTTP.php $(peardir)
phpincludedir = $(includedir)/php
builddir = $(prefix)/lib/php/build