function testAddDriver()
 {
     DatabaseDriverManager::addDriver('CantRun', 'DatabaseDriverManagerTest', false);
     $this->assertFalse(DatabaseDriverManager::canDriverRun('CantRun'));
     $r = DatabaseDriverManager::addDriver('CantRun', 'DatabaseDriverManagerTest', false);
     $this->assertTrue($r->is(new Error('DBDRIVER_ALREADY_ADDED', 'CantRun')));
     $r = DatabaseDriverManager::addDriver('InvalidClass', 'InvalidClassName', false);
     $this->assertTrue($r->is(new Error('DBDRIVERCLASS_NOTFOUND', 'InvalidClass', 'InvalidClassName')));
 }
                    $allTables[] = $row[0];
                }
                return $allTables;
            } else {
                return $q;
            }
        }
        function escapeString($value)
        {
            if (get_magic_quotes_gpc()) {
                $value = stripslashes($value);
            }
            return $this->_mysqli->escape_string($value);
        }
        function tableExists($tableName)
        {
            $allTables = $this->getAllTables();
            if (in_array($this->getPrefix() . $tableName, $allTables)) {
                return true;
            } else {
                return in_array(strtolower($this->getPrefix() . $tableName), $allTables);
            }
        }
        function getSQLCreator()
        {
            return 'DataMySQLCompatLayer';
        }
    }
}
DatabaseDriverManager::addDriver('MySQLI', 'MySQLIDatabaseDriver', class_exists('mysqli'));
            $q = $this->query("SELECT table_name FROM information_schema.tables WHERE table_schema='public'");
            if (!isError($q)) {
                $allTables = array();
                while ($row = pg_fetch_assoc($q)) {
                    $allTables[] = $row['table_name'];
                }
                return $allTables;
            } else {
                return $q;
            }
        }
        function escapeString($value)
        {
            if (get_magic_quotes_gpc()) {
                $value = stripslashes($value);
            }
            return pg_escape_string($value);
        }
        function tableExists($tableName)
        {
            $allTables = $this->getAllTables();
            if (in_array($this->getPrefix() . $tableName, $allTables)) {
                return true;
            } else {
                return in_array(strtolower($this->getPrefix() . $tableName), $allTables);
            }
        }
    }
}
DatabaseDriverManager::addDriver('PostgreSQL', 'PgSQLDatabaseDriver', function_exists('pg_connect'));