1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-13 01:24:06 +02:00

typos & whitespace

This commit is contained in:
David Grudl
2013-12-30 23:19:42 +01:00
parent 6f99db544f
commit 8112fe10d0
51 changed files with 592 additions and 1412 deletions

View File

@@ -2,11 +2,7 @@
/**
* This file is part of the "dibi" - smart database abstraction layer.
*
* Copyright (c) 2005 David Grudl (http://davidgrudl.com)
*
* For the full copyright and license information, please view
* the file license.txt that was distributed with this source code.
*/
@@ -44,7 +40,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
private $fmtDate, $fmtDateTime;
/**
* @throws DibiNotSupportedException
*/
@@ -56,13 +51,12 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Connects to a database.
* @return void
* @throws DibiException
*/
public function connect(array &$config)
public function connect(array & $config)
{
$foo = & $config['charset'];
$this->fmtDate = isset($config['formatDate']) ? $config['formatDate'] : 'U';
@@ -81,7 +75,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Disconnects from a database.
* @return void
@@ -92,7 +85,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Executes the SQL query.
* @param string SQL statement.
@@ -118,7 +110,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
* @return int|FALSE number of rows or FALSE on error
@@ -129,7 +120,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
* @return int|FALSE int on success or FALSE on failure
@@ -141,7 +131,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Begins a transaction (if supported).
* @param string optional savepoint name
@@ -153,7 +142,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Commits statements in a transaction.
* @param string optional savepoint name
@@ -170,7 +158,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Rollback changes in a transaction.
* @param string optional savepoint name
@@ -187,7 +174,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Returns the connection resource.
* @return mixed
@@ -198,7 +184,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Returns the connection reflector.
* @return IDibiReflector
@@ -209,7 +194,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Result set driver factory.
* @param resource
@@ -223,11 +207,9 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/********************* SQL ****************d*g**/
/**
* Encodes data for use in a SQL statement.
* @param mixed value
@@ -238,30 +220,29 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
public function escape($value, $type)
{
switch ($type) {
case dibi::TEXT:
case dibi::BINARY:
return "'" . str_replace("'", "''", $value) . "'"; // TODO: not tested
case dibi::TEXT:
case dibi::BINARY:
return "'" . str_replace("'", "''", $value) . "'"; // TODO: not tested
case dibi::IDENTIFIER:
// @see http://download.oracle.com/docs/cd/B10500_01/server.920/a96540/sql_elements9a.htm
return '"' . str_replace('"', '""', $value) . '"';
case dibi::IDENTIFIER:
// @see http://download.oracle.com/docs/cd/B10500_01/server.920/a96540/sql_elements9a.htm
return '"' . str_replace('"', '""', $value) . '"';
case dibi::BOOL:
return $value ? 1 : 0;
case dibi::BOOL:
return $value ? 1 : 0;
case dibi::DATE:
return $value instanceof DateTime ? $value->format($this->fmtDate) : date($this->fmtDate, $value);
case dibi::DATE:
return $value instanceof DateTime ? $value->format($this->fmtDate) : date($this->fmtDate, $value);
case dibi::DATETIME:
return $value instanceof DateTime ? $value->format($this->fmtDateTime) : date($this->fmtDateTime, $value);
case dibi::DATETIME:
return $value instanceof DateTime ? $value->format($this->fmtDateTime) : date($this->fmtDateTime, $value);
default:
throw new InvalidArgumentException('Unsupported type.');
default:
throw new InvalidArgumentException('Unsupported type.');
}
}
/**
* Encodes string for use in a LIKE statement.
* @param string
@@ -276,7 +257,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Decodes data from result set.
* @param string value
@@ -293,15 +273,11 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Injects LIMIT/OFFSET to the SQL query.
* @param string &$sql The SQL query that will be modified.
* @param int $limit
* @param int $offset
* @return void
*/
public function applyLimit(&$sql, $limit, $offset)
public function applyLimit(& $sql, $limit, $offset)
{
if ($offset > 0) {
// see http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
@@ -313,11 +289,9 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/********************* result set ****************d*g**/
/**
* Automatically frees the resources allocated for this result set.
* @return void
@@ -328,7 +302,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Returns the number of rows in a result set.
* @return int
@@ -339,7 +312,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* @param bool TRUE for associative array, FALSE for numeric
@@ -351,7 +323,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Moves cursor position without fetching row.
* @param int the 0-based cursor pos to seek to
@@ -363,7 +334,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Frees the resources allocated for this result set.
* @return void
@@ -375,7 +345,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Returns metadata for all columns in a result set.
* @return array
@@ -396,7 +365,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Returns the result set resource.
* @return mixed
@@ -408,11 +376,9 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/********************* IDibiReflector ****************d*g**/
/**
* Returns list of tables.
* @return array
@@ -433,7 +399,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Returns metadata for all columns in a table.
* @param string
@@ -445,7 +410,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Returns metadata for all indexes in a table.
* @param string
@@ -457,7 +421,6 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
}
/**
* Returns metadata for all foreign keys in a table.
* @param string