1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-30 09:19:48 +02:00

Compare commits

..

15 Commits
v2.1.1 ... v2.1

Author SHA1 Message Date
David Grudl
cd7362efa6 Released version 2.1.3
This release marks the end of life of 2.1 series.
2015-01-13 05:56:52 +01:00
Petr BAGR Smrkovský
fa342fd240 DibiResult: float detection locale fix [Closes #154] 2015-01-13 05:53:54 +01:00
Pavel Zelezny
2277896109 Oracle use double quotes for escaping 2015-01-13 05:53:54 +01:00
Rossler Jan
f9c9003fc1 PostgreSQL: fixed identifier escaping in reflection. 2015-01-13 05:53:53 +01:00
David Grudl
12bebf8049 Released version 2.1.2 2014-05-13 17:24:59 +02:00
David Grudl
8a2f09033a updated examples, SQlite3 is used instead of SQLite2 2014-05-13 17:24:59 +02:00
David Grudl
ca839c5fbf bridges: changed file structure 2014-05-13 17:01:38 +02:00
David Grudl
2890690133 typos 2014-05-13 17:01:37 +02:00
David Grudl
3c8ceebe27 updated test support files 2014-05-13 17:01:37 +02:00
Emmanuel еΜanwʬĔbdƎv
8ed72797e3 readme.md: typos 2014-05-13 17:01:36 +02:00
Caspern
8ddbb41a1f .gitattributes: ignoring some paths when downloading from github 2014-05-13 17:01:36 +02:00
Ciki
1dc57bad85 fix casting to float
Now, when sql returns float from (0,1) interval, e.g. '.842' - the decimal part is missing & it won't get cast to float.
This is fix for that situation
2014-05-13 17:01:35 +02:00
David Grudl
6016f21ad4 DibiRow: null time checking consistent with DibiResult 2014-05-13 17:01:34 +02:00
Ondrej Brablc
d75e605645 Avoid error handler invocation 2014-05-13 17:01:34 +02:00
David Grudl
fa5b7678f4 phpDoc simplified & typos 2014-05-13 17:01:23 +02:00
61 changed files with 89 additions and 222 deletions

4
.gitattributes vendored Normal file
View File

@@ -0,0 +1,4 @@
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
tests/ export-ignore

View File

@@ -3,15 +3,18 @@
"description": "Dibi is Database Abstraction Library for PHP 5.",
"keywords": ["database", "dbal", "mysql", "postgresql", "sqlite", "mssql", "oracle", "access", "pdo", "odbc"],
"homepage": "http://dibiphp.com/",
"license": ["BSD-3", "GPLv2", "GPLv3"],
"license": ["BSD-3-Clause", "GPL-2.0", "GPL-3.0"],
"authors": [
{
"name": "David Grudl",
"homepage": "http://davidgrudl.com"
}
],
"require": {
"php": ">=5.2.0"
},
"require-dev": {
"nette/tester": "@dev"
"nette/tester": "~1.1"
},
"replace": {
"dg/dibi": "self.version"

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.
*/

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.
*/
@@ -106,7 +102,7 @@ class DibiNettePanel extends DibiObject implements IBarPanel
}
return '<span title="dibi"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAEYSURBVBgZBcHPio5hGAfg6/2+R980k6wmJgsJ5U/ZOAqbSc2GnXOwUg7BESgLUeIQ1GSjLFnMwsKGGg1qxJRmPM97/1zXFAAAAEADdlfZzr26miup2svnelq7d2aYgt3rebl585wN6+K3I1/9fJe7O/uIePP2SypJkiRJ0vMhr55FLCA3zgIAOK9uQ4MS361ZOSX+OrTvkgINSjS/HIvhjxNNFGgQsbSmabohKDNoUGLohsls6BaiQIMSs2FYmnXdUsygQYmumy3Nhi6igwalDEOJEjPKP7CA2aFNK8Bkyy3fdNCg7r9/fW3jgpVJbDmy5+PB2IYp4MXFelQ7izPrhkPHB+P5/PjhD5gCgCenx+VR/dODEwD+A3T7nqbxwf1HAAAAAElFTkSuQmCC" />'
. count($this->events) . ' queries'
. ($totalTime ? ' / ' . sprintf('%0.1f', $totalTime * 1000) . 'ms' : '')
. ($totalTime ? sprintf(' / %0.1f ms', $totalTime * 1000) : '')
. '</span>';
}
@@ -158,7 +154,7 @@ class DibiNettePanel extends DibiObject implements IBarPanel
'<style> #nette-debug td.nette-DibiProfiler-sql { background: white !important }
#nette-debug .nette-DibiProfiler-source { color: #999 !important }
#nette-debug nette-DibiProfiler tr table { margin: 8px 0; max-height: 150px; overflow:auto } </style>
<h1>Queries: ' . count($this->events) . ($totalTime === NULL ? '' : ', time: ' . sprintf('%0.3f', $totalTime * 1000) . ' ms') . '</h1>
<h1>Queries: ' . count($this->events) . ($totalTime === NULL ? '' : sprintf(', time: %0.3f ms', $totalTime * 1000)) . '</h1>
<div class="nette-inner nette-DibiProfiler">
<table>
<tr><th>Time&nbsp;ms</th><th>SQL Statement</th><th>Rows</th><th>Connection</th></tr>' . $s . '

View File

@@ -4,9 +4,6 @@
* dibi - smart database abstraction layer (http://dibiphp.com)
*
* Copyright (c) 2005, 2012 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.
*/
@@ -17,8 +14,6 @@ if (version_compare(PHP_VERSION, '5.2.0', '<')) {
throw new Exception('dibi needs PHP 5.2.0 or newer.');
}
@set_magic_quotes_runtime(FALSE); // intentionally @
require_once dirname(__FILE__) . '/libs/interfaces.php';
require_once dirname(__FILE__) . '/libs/DibiDateTime.php';
@@ -38,7 +33,7 @@ require_once dirname(__FILE__) . '/libs/DibiEvent.php';
require_once dirname(__FILE__) . '/libs/DibiFileLogger.php';
require_once dirname(__FILE__) . '/libs/DibiFirePhpLogger.php';
if (interface_exists('Nette\Diagnostics\IBarPanel') || interface_exists('IBarPanel')) {
require_once dirname(__FILE__) . '/bridges/Nette/DibiNettePanel.php';
require_once dirname(__FILE__) . '/bridges/Nette-2.1/DibiNettePanel.php';
}
@@ -76,8 +71,8 @@ class dibi
FIELD_TIME = dibi::TIME;
/** version */
const VERSION = '2.1.1',
REVISION = '$WCREV$ released on $WCDATE$';
const VERSION = '2.1.3',
REVISION = 'released on 2015-01-13';
/** sorting order */
const ASC = 'ASC',
@@ -267,7 +262,7 @@ class dibi
/**
* Executes SQL query and fetch results - Monostate for DibiConnection::query() & fetchAll().
* @param array|mixed one or more arguments
* @return array of DibiRow
* @return DibiRow[]
* @throws DibiException
*/
public static function fetchAll($args)

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.
*/

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.
*/

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.
*/

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.
*/
require_once dirname(__FILE__) . '/DibiMsSqlReflector.php';

View File

@@ -5,9 +5,6 @@
*
* Copyright (c) 2005, 2010 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.
*
* @package dibi\drivers
*/

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.
*/

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.
*/

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.
*/
@@ -461,7 +457,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri
public function getResultResource()
{
$this->autoFree = FALSE;
return @$this->resultSet->type === NULL ? NULL : $this->resultSet;
return $this->resultSet === NULL || $this->resultSet->type === NULL ? NULL : $this->resultSet;
}
}

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.
*/

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.
*/

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.
*/
@@ -259,6 +255,7 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
case 'mysql':
return '`' . str_replace('`', '``', $value) . '`';
case 'oci':
case 'pgsql':
return '"' . str_replace('"', '""', $value) . '"';
@@ -267,7 +264,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
return '[' . strtr($value, '[]', ' ') . ']';
case 'odbc':
case 'oci': // TODO: not tested
case 'mssql':
return '[' . str_replace(array('[', ']'), array('[[', ']]'), $value) . ']';

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.
*/
@@ -320,7 +316,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
$value = pg_escape_string($this->connection, $value);
} else {
$value = pg_escape_string($value);
}
}
$value = strtr($value, array( '%' => '\\\\%', '_' => '\\\\_'));
return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'");
@@ -486,7 +482,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
*/
public function getColumns($table)
{
$_table = $this->escape($table, dibi::TEXT);
$_table = $this->escape($this->escape($table, dibi::IDENTIFIER), dibi::TEXT);
$res = $this->query("
SELECT indkey
FROM pg_class
@@ -526,7 +522,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
*/
public function getIndexes($table)
{
$_table = $this->escape($table, dibi::TEXT);
$_table = $this->escape($this->escape($table, dibi::IDENTIFIER), dibi::TEXT);
$res = $this->query("
SELECT ordinal_position, column_name
FROM information_schema.columns
@@ -567,7 +563,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
*/
public function getForeignKeys($table)
{
$_table = $this->escape($table, dibi::TEXT);
$_table = $this->escape($this->escape($table, dibi::IDENTIFIER), dibi::TEXT);
$res = $this->query("
SELECT

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.
*/

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.
*/

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.
*/

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.
*/
@@ -590,7 +586,7 @@ class DibiConnection extends DibiObject
/**
* Executes SQL query and fetch results - shortcut for query() & fetchAll().
* @param array|mixed one or more arguments
* @return array of DibiRow
* @return DibiRow[]
* @throws DibiException
*/
public function fetchAll($args)

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.
*/

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.
*/
@@ -49,7 +45,7 @@ class DibiDatabaseInfo extends DibiObject
/**
* @return array of DibiTableInfo
* @return DibiTableInfo[]
*/
public function getTables()
{
@@ -59,7 +55,7 @@ class DibiDatabaseInfo extends DibiObject
/**
* @return array of string
* @return string[]
*/
public function getTableNames()
{
@@ -181,7 +177,7 @@ class DibiTableInfo extends DibiObject
/**
* @return array of DibiColumnInfo
* @return DibiColumnInfo[]
*/
public function getColumns()
{
@@ -191,7 +187,7 @@ class DibiTableInfo extends DibiObject
/**
* @return array of string
* @return string[]
*/
public function getColumnNames()
{
@@ -233,7 +229,7 @@ class DibiTableInfo extends DibiObject
/**
* @return array of DibiForeignKeyInfo
* @return DibiForeignKeyInfo[]
*/
public function getForeignKeys()
{
@@ -243,7 +239,7 @@ class DibiTableInfo extends DibiObject
/**
* @return array of DibiIndexInfo
* @return DibiIndexInfo[]
*/
public function getIndexes()
{
@@ -336,7 +332,7 @@ class DibiResultInfo extends DibiObject
/**
* @return array of DibiColumnInfo
* @return DibiColumnInfo[]
*/
public function getColumns()
{
@@ -347,7 +343,7 @@ class DibiResultInfo extends DibiObject
/**
* @param bool
* @return array of string
* @return string[]
*/
public function getColumnNames($fullNames = FALSE)
{

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.
*/

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.
*/

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.
*/

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.
*/
@@ -64,7 +60,7 @@ class DibiFileLogger extends DibiObject
fwrite($handle,
"OK: " . $event->sql
. ($event->count ? ";\n-- rows: " . $event->count : '')
. "\n-- takes: " . sprintf('%0.3f', $event->time * 1000) . ' ms'
. "\n-- takes: " . sprintf('%0.3f ms', $event->time * 1000)
. "\n-- source: " . implode(':', $event->source)
. "\n-- driver: " . $event->connection->getConfig('driver') . '/' . $event->connection->getConfig('name')
. "\n-- " . date('Y-m-d H:i:s')

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.
*/

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.
*/

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.
*/

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.
*/
@@ -14,6 +10,7 @@
* SQL literal value.
*
* @author David Grudl
* @package dibi
*/
class DibiLiteral extends DibiObject
{

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.
*/

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.
*/
@@ -245,7 +241,7 @@ class DibiResult extends DibiObject implements IDataSource
* Fetches all records from table.
* @param int offset
* @param int limit
* @return array of DibiRow
* @return DibiRow[]
*/
final public function fetchAll($offset = NULL, $limit = NULL)
{
@@ -518,7 +514,7 @@ class DibiResult extends DibiObject implements IDataSource
$row[$key] = is_float($tmp = $value * 1) ? $value : $tmp;
} elseif ($type === dibi::FLOAT) {
$row[$key] = (string) ($tmp = (float) $value) === rtrim(rtrim($value, '0'), '.') ? $tmp : $value;
$row[$key] = str_replace(',', '.', ltrim((string) ($tmp = (float) $value), '0')) === ltrim(rtrim(rtrim($value, '0'), '.'), '0') ? $tmp : $value;
} elseif ($type === dibi::BOOL) {
$row[$key] = ((bool) $value) && $value !== 'f' && $value !== 'F';

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.
*/

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.
*/
@@ -43,7 +39,7 @@ class DibiRow implements ArrayAccess, IteratorAggregate, Countable
{
$time = $this[$key];
if (!$time instanceof DibiDateTime) {
if ((int) $time === 0) { // '', NULL, FALSE, '0000-00-00', ...
if ((int) $time === 0 && substr((string) $time, 0, 3) !== '00:') { // '', NULL, FALSE, '0000-00-00', ...
return NULL;
}
$time = new DibiDateTime(is_numeric($time) ? date('Y-m-d H:i:s', $time) : $time);
@@ -60,10 +56,7 @@ class DibiRow implements ArrayAccess, IteratorAggregate, Countable
public function asTimestamp($key)
{
trigger_error(__METHOD__ . '() is deprecated.', E_USER_WARNING);
$time = $this[$key];
return (int) $time === 0 // '', NULL, FALSE, '0000-00-00', ...
? NULL
: (is_numeric($time) ? (int) $time : strtotime($time));
return $this->asDateTime($key, 'U');
}

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.
*/

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.
*/

View File

@@ -12,8 +12,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
echo '<p>Connecting to Sqlite: ';
try {
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));
echo 'OK';
@@ -27,8 +27,8 @@ echo "</p>\n";
echo '<p>Connecting to Sqlite: ';
try {
$connection = new DibiConnection(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));
echo 'OK';

View File

@@ -2,7 +2,7 @@ body {
font: 15px/1.5 Tahoma, Verdana, Myriad Web, Syntax, sans-serif;
color: #333;
background: #fff url('dibi-powered.gif') no-repeat 99% 1em;
margin: 1.6em;
margin: 1.6em;
padding: 0;
}

View File

@@ -9,8 +9,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -9,8 +9,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -10,8 +10,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
ndebug();
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -9,8 +9,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -19,8 +19,8 @@ ndebug();
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
'profiler' => array(
'run' => TRUE,
)
@@ -32,8 +32,8 @@ dibi::query('SELECT * FROM customers WHERE customer_id < ?', 38);
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
'profiler' => array(
'run' => TRUE,
)

View File

@@ -21,8 +21,8 @@ NDebugger::enable();
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
'profiler' => array(
'run' => TRUE,
)

View File

@@ -12,8 +12,8 @@ date_default_timezone_set('Europe/Prague');
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -12,8 +12,8 @@ date_default_timezone_set('Europe/Prague');
// CHANGE TO REAL PARAMETERS!
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
'formatDate' => "'Y-m-d'",
'formatDateTime' => "'Y-m-d H-i-s'",
));

View File

@@ -10,8 +10,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
ndebug();
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -11,8 +11,8 @@ date_default_timezone_set('Europe/Prague');
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -9,8 +9,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -11,8 +11,8 @@ date_default_timezone_set('Europe/Prague');
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
// enable query logging to this file
'profiler' => array(
'run' => TRUE,

View File

@@ -11,8 +11,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
'profiler' => array(
'run' => TRUE,
)

View File

@@ -9,8 +9,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -9,8 +9,8 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
dibi::connect(array(
'driver' => 'sqlite',
'database' => 'data/sample.sdb',
'driver' => 'sqlite3',
'database' => 'data/sample.s3db',
));

View File

@@ -16,7 +16,7 @@ remains intact.
New BSD License
---------------
Copyright (c) 2004, 2013 David Grudl (http://davidgrudl.com)
Copyright (c) 2004, 2014 David Grudl (http://davidgrudl.com)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,

View File

@@ -2,15 +2,15 @@
=========================================================
Database access functions in PHP are not standardised. This library
hides the differences between them, a above all, it gives you a very handy interface.
hides the differences between them, and above all, it gives you a very handy interface.
The best way how to install Dibi is to use a [Composer](http://getcomposer.org/download):
The best way to install Dibi is to use a [Composer](http://getcomposer.org/download):
php composer.phar require dibi/dibi
Or you can download a latest package from http://dibiphp.com. In this
Or you can download the latest package from http://dibiphp.com. In this
package is also `Dibi.minified`, shrinked single-file version of whole Dibi,
useful when you don't want to modify library, but just use it.
useful when you don't want to modify the library, but just use it.
Dibi requires PHP 5.2.0 or later. It has been tested with PHP 5.5 too.

View File

@@ -1,18 +1,20 @@
<?php
/**
* Test initialization and helpers.
*
* @author David Grudl
* @package Nette\Test
*/
// The Nette Tester command-line runner can be
// invoked through the command: ../../vendor/bin/tester .
require dirname(__FILE__) . '/../vendor/nette/tester/Tester/bootstrap.php';
require dirname(__FILE__) . '/../dibi/dibi.php';
if (@!include __DIR__ . '/../vendor/autoload.php') {
echo 'Install Nette Tester using `composer update --dev`';
exit(1);
}
// configure environment
Tester\Environment::setup();
date_default_timezone_set('Europe/Prague');
class_alias('Tester\Assert', 'Assert');
// load connections
define('DIR', dirname(__FILE__));
$config = parse_ini_file(dirname(__FILE__) . '/config.ini', TRUE);

View File

@@ -1 +1 @@
Dibi 2.1.1 (revision $WCREV$ released on $WCDATE$)
Dibi 2.1.3 (released on 2015-01-13)