1
0
mirror of https://github.com/dg/dibi.git synced 2025-09-03 19:12:33 +02:00

Compare commits

...

7 Commits

Author SHA1 Message Date
David Grudl
6f99db544f released 2.0.3 2013-04-03 14:40:16 +02:00
David Grudl
c399d79ab8 DibiResult: fixed detection of "123.000" as float [Closes #67] 2013-04-03 14:40:15 +02:00
David Grudl
67f8468a38 added .gitignore 2013-04-03 14:31:50 +02:00
David Grudl
72944ae012 composer: renamed to dibi/dibi 2013-04-03 14:30:29 +02:00
David Grudl
4843882e61 MySQLI: mysqli_affected_rows() returns -1 on error [Closes #80] 2013-04-03 14:29:46 +02:00
Filip Procházka
669ce73096 PdoDriver: fix notice undefined index native_type 2013-04-03 14:29:25 +02:00
David Grudl
6e4a6474cd dibi::$sql is always set 2013-04-03 14:28:15 +02:00
8 changed files with 13 additions and 7 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/vendor
/composer.lock

View File

@@ -1,7 +1,7 @@
{
"name": "dg/dibi",
"name": "dibi/dibi",
"description": "Dibi is Database Abstraction Library for PHP 5.",
"keywords": ["dibi", "database", "dbal", "mysql", "postgresql", "sqlite", "mssql", "oracle", "access", "pdo", "odbc"],
"keywords": ["database", "dbal", "mysql", "postgresql", "sqlite", "mssql", "oracle", "access", "pdo", "odbc"],
"homepage": "http://dibiphp.com/",
"license": ["BSD-3", "GPLv2", "GPLv3"],
"authors": [

View File

@@ -80,7 +80,7 @@ class dibi
FIELD_TIME = dibi::TIME;
/** version */
const VERSION = '2.0.2',
const VERSION = '2.0.3',
REVISION = '$WCREV$ released on $WCDATE$';
/** sorting order */

View File

@@ -194,7 +194,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri
*/
public function getAffectedRows()
{
return mysqli_affected_rows($this->connection);
return mysqli_affected_rows($this->connection) === -1 ? FALSE : mysqli_affected_rows($this->connection);
}

View File

@@ -451,7 +451,10 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
}
// PHP < 5.2.3 compatibility
// @see: http://php.net/manual/en/pdostatement.getcolumnmeta.php#pdostatement.getcolumnmeta.changelog
$row['table'] = isset($row['table']) ? $row['table'] : NULL;
$row = $row + array(
'table' => NULL,
'native_type' => 'VAR_STRING',
);
$columns[] = array(
'name' => $row['name'],

View File

@@ -338,6 +338,7 @@ class DibiConnection extends DibiObject
{
$this->connected || $this->connect();
dibi::$sql = $sql;
$event = $this->onEvent ? new DibiEvent($this, DibiEvent::QUERY, $sql) : NULL;
try {
$res = $this->driver->query($sql);

View File

@@ -514,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) === $value ? $tmp : $value;
$row[$key] = (string) ($tmp = (float) $value) === rtrim(rtrim($value, '0'), '.') ? $tmp : $value;
} elseif ($type === dibi::BOOL) {
$row[$key] = ((bool) $value) && $value !== 'f' && $value !== 'F';

View File

@@ -1 +1 @@
Dibi 2.0.2 (revision $WCREV$ released on $WCDATE$)
Dibi 2.0.3 (revision $WCREV$ released on $WCDATE$)