mirror of
https://github.com/dg/dibi.git
synced 2025-08-11 16:44:30 +02:00
all file names correspond with class name
This commit is contained in:
@@ -89,10 +89,10 @@ class DibiConnection extends DibiObject
|
||||
$config['driver'] = dibi::$defaultDriver;
|
||||
}
|
||||
|
||||
$driver = preg_replace('#[^a-z0-9_]#', '_', strtolower($config['driver']));
|
||||
$class = "Dibi" . $driver . "Driver";
|
||||
$class = preg_replace(array('#\W#', '#sql#'), array('_', 'Sql'), ucfirst(strtolower($config['driver'])));
|
||||
$class = "Dibi{$class}Driver";
|
||||
if (!class_exists($class, FALSE)) {
|
||||
include_once dirname(__FILE__) . "/../drivers/$driver.php";
|
||||
include_once dirname(__FILE__) . "/../drivers/$class.php";
|
||||
|
||||
if (!class_exists($class, FALSE)) {
|
||||
throw new DibiException("Unable to create instance of dibi driver '$class'.");
|
||||
|
@@ -75,7 +75,7 @@ class DibiDataSource extends DibiObject implements IDataSource
|
||||
/**
|
||||
* Selects columns to query.
|
||||
* @param string|array column name or array of column names
|
||||
* @param string column alias
|
||||
* @param string column alias
|
||||
* @return DibiDataSource provides a fluent interface
|
||||
*/
|
||||
public function select($col, $as = NULL)
|
||||
@@ -113,7 +113,7 @@ class DibiDataSource extends DibiObject implements IDataSource
|
||||
/**
|
||||
* Selects columns to order by.
|
||||
* @param string|array column name or array of column names
|
||||
* @param string sorting direction
|
||||
* @param string sorting direction
|
||||
* @return DibiDataSource provides a fluent interface
|
||||
*/
|
||||
public function orderBy($row, $sorting = 'ASC')
|
||||
|
@@ -218,7 +218,7 @@ final class DibiTranslator extends DibiObject
|
||||
|
||||
} else {
|
||||
$v = $this->formatValue($v, $pair[1]);
|
||||
if ($pair[1] === 'l' || $pair[1] === 'in') {
|
||||
if ($pair[1] === 'l' || $pair[1] === 'in') {
|
||||
$op = 'IN ';
|
||||
} elseif (strpos($pair[1], 'like') !== FALSE) {
|
||||
$op = 'LIKE ';
|
||||
|
Reference in New Issue
Block a user