Subversion Repositories PHPX

Compare Revisions

Last modification

Ignore whitespace Rev 27 → Rev 29

/trunk/Db/MySQLDB.php
1,6 → 1,6
<?php
 
require_once 'lib/Db/Database.php';
require_once __DIR__ . '/Database.php';
 
class MySQLDB extends Database
{
/trunk/Db/ODBCDB.php
1,6 → 1,6
<?php
 
require_once 'lib/Db/Database.php';
require_once __DIR__ . '/Database.php';
 
class ODBCDB extends Database
{
12,38 → 12,13
public function __construct()
{
$this->_connection = @odbc_connect($this->_alias, "" ,"");
// $this->_connection = @odbc_connect($this->_alias, $this->_username, $this->_password);
$this->_dsn = 'odbc:' . $this->_alias;
parent::__construct();
}
/**
* Escapes a database name so that it can be used in a query.
*
* @param string $name
* The name to be escaped
* @return string
* The escaped name
*/
public function escapeName($name)
{
return '[' . $name . ']';
}
 
/**
* (non-PHPdoc)
* @see Database::_escapeAliasArray()
*/
protected function _escapeAliasArray(array &$array)
{
foreach ($array as $column => &$value)
{
$value = $value . ' AS [' . $column . ']';
}
return $array;
}
 
/**
* (non-PHPdoc)
* @see Database::_escapeValueArray()
*/
protected function _escapeValueArray(array &$array, $suffix = '', array &$escape = array('`', '`'))
/trunk/Db/Adapter.php
1,6 → 1,6
<?php
 
require_once 'lib/Model.php';
require_once __DIR__ . '/../Model.php';
 
abstract class Adapter
{
/trunk/Db/Database.php
1,8 → 1,8
<?php
 
require_once 'lib/global.inc';
require_once __DIR__ . '/../global.inc';
 
require_once 'lib/AbstractModel.php';
require_once __DIR__ . '/../AbstractModel.php';
 
/**
* Generic database model class using PDO (PHP Data Objects)
/trunk/Db/Mapper.php
1,6 → 1,6
<?php
 
require_once 'lib/Db/Table.php';
require_once __DIR__ . '/Table.php';
 
/**
* Generic abstract database mapper class
/trunk/Db/MySQLAdapter.php
1,7 → 1,7
<?php
 
require_once 'lib/Db/Adapter.php';
require_once 'lib/Db/MySQLDB.php';
require_once __DIR__ . '/Adapter.php';
require_once __DIR__ . '/MySQLDB.php';
 
class MySQLAdapter extends Adapter
{
/trunk/Db/Table.php
1,6 → 1,6
<?php
 
require_once 'lib/AbstractModel.php';
require_once __DIR__ . '/../AbstractModel.php';
 
/**
* Generic database table model class
/trunk/Db/AccessDB.php
0,0 → 1,33
<?php
 
require_once __DIR__ . '/ODBCDB.php';
 
class AccessDB extends ODBCDB
{
/**
* Escapes a database name so that it can be used in a query.
*
* @param string $name
* The name to be escaped
* @return string
* The escaped name
*/
public function escapeName($name)
{
return '[' . $name . ']';
}
 
/**
* (non-PHPdoc)
* @see Database::_escapeAliasArray()
*/
protected function _escapeAliasArray(array &$array)
{
foreach ($array as $column => &$value)
{
$value = $value . ' AS [' . $column . ']';
}
return $array;
}
}
/trunk/Db/database.class.php
1,6 → 1,6
<?php
 
require_once 'global.inc';
require_once __LIB__ . '/../global.inc';
 
/* NOTE: Obsolete with autoloader */
//require_once 'Zend/Registry.php';