diff --git a/dibi/dibi.php b/dibi/dibi.php index 8e14571a..926c4efb 100644 --- a/dibi/dibi.php +++ b/dibi/dibi.php @@ -9,13 +9,13 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @author David Grudl * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license + * @license http://dibiphp.com/license dibi license * @version 0.9 (Revision: $WCREV$, Date: $WCDATE$) - * @link http://php7.org/dibi/ + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/drivers/mssql.php b/dibi/drivers/mssql.php index c08b2ba1..1348406e 100644 --- a/dibi/drivers/mssql.php +++ b/dibi/drivers/mssql.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/drivers/mysql.php b/dibi/drivers/mysql.php index 41b0a2e7..24c21b1e 100644 --- a/dibi/drivers/mysql.php +++ b/dibi/drivers/mysql.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ @@ -32,6 +32,7 @@ * - 'charset' - character encoding to set * - 'unbuffered' - sends query without fetching and buffering the result rows automatically? * - 'options' - driver specific constants (MYSQL_*) + * - 'sqlmode' - see http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html * - 'lazy' - if TRUE, connection will be established only when required * * @author David Grudl @@ -124,7 +125,7 @@ class DibiMySqlDriver extends NObject implements DibiDriverInterface // affects the character set used by mysql_real_escape_string() (was added in MySQL 5.0.7 and PHP 5.2.3) $ok = @mysql_set_charset($config['charset'], $this->connection); } - if (!$ok) $ok = @mysql_query("SET NAMES '" . $config['charset'] . "'", $this->connection); + if (!$ok) $ok = @mysql_query("SET NAMES '$config[charset]'", $this->connection); if (!$ok) $this->throwException(); } @@ -132,6 +133,10 @@ class DibiMySqlDriver extends NObject implements DibiDriverInterface @mysql_select_db($config['database'], $this->connection) or $this->throwException(); } + if (isset($config['sqlmode'])) { + if (!@mysql_query("SET sql_mode='$config[sqlmode]'", $this->connection)) $this->throwException(); + } + $this->buffered = empty($config['unbuffered']); } diff --git a/dibi/drivers/mysqli.php b/dibi/drivers/mysqli.php index ac165e76..b86c0052 100644 --- a/dibi/drivers/mysqli.php +++ b/dibi/drivers/mysqli.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ @@ -32,6 +32,7 @@ * - 'charset' - character encoding to set * - 'unbuffered' - sends query without fetching and buffering the result rows automatically? * - 'options' - driver specific constants (MYSQLI_*) + * - 'sqlmode' - see http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html * - 'lazy' - if TRUE, connection will be established only when required * * @author David Grudl @@ -109,10 +110,14 @@ class DibiMySqliDriver extends NObject implements DibiDriverInterface if (isset($config['charset'])) { // affects the character set used by mysql_real_escape_string() (was added in MySQL 5.0.7 and PHP 5.0.5) $ok = @mysqli_set_charset($this->connection, $config['charset']); - if (!$ok) $ok = @mysqli_query($this->connection, "SET NAMES '" . $config['charset'] . "'"); + if (!$ok) $ok = @mysqli_query($this->connection, "SET NAMES '$config[charset]'"); if (!$ok) $this->throwException(); } + if (isset($config['sqlmode'])) { + if (!@mysqli_query($this->connection, "SET sql_mode='$config[sqlmode]'")) $this->throwException(); + } + $this->buffered = empty($config['unbuffered']); } diff --git a/dibi/drivers/odbc.php b/dibi/drivers/odbc.php index 6666f16a..99662a33 100644 --- a/dibi/drivers/odbc.php +++ b/dibi/drivers/odbc.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/drivers/oracle.php b/dibi/drivers/oracle.php index cc9a0d14..8bc796ea 100644 --- a/dibi/drivers/oracle.php +++ b/dibi/drivers/oracle.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/drivers/pdo.php b/dibi/drivers/pdo.php index 29047913..bef6a453 100644 --- a/dibi/drivers/pdo.php +++ b/dibi/drivers/pdo.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/drivers/postgre.php b/dibi/drivers/postgre.php index cf2c0528..19b3c48a 100644 --- a/dibi/drivers/postgre.php +++ b/dibi/drivers/postgre.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ @@ -163,16 +163,16 @@ class DibiPostgreDriver extends NObject implements DibiDriverInterface { if ($sequence === NULL) { // PostgreSQL 8.1 is needed - $has = $this->query("SELECT LASTVAL() AS seq"); + $has = $this->query("SELECT LASTVAL()"); } else { - $has = $this->query("SELECT CURRVAL('$sequence') AS seq"); + $has = $this->query("SELECT CURRVAL('$sequence')"); } if (!$has) return FALSE; - $row = $this->fetch(); + $row = $this->fetch(FALSE); $this->free(); - return isset($row['seq']) ? $row['seq'] : FALSE; + return is_array($row) ? $row[0] : FALSE; } diff --git a/dibi/drivers/sqlite.php b/dibi/drivers/sqlite.php index 9c51659f..29ceb842 100644 --- a/dibi/drivers/sqlite.php +++ b/dibi/drivers/sqlite.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/libs/DibiConnection.php b/dibi/libs/DibiConnection.php index 3aca8c9a..b25d7956 100644 --- a/dibi/libs/DibiConnection.php +++ b/dibi/libs/DibiConnection.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/libs/DibiDriverInterface.php b/dibi/libs/DibiDriverInterface.php index 8cc620e5..ed97fcb7 100644 --- a/dibi/libs/DibiDriverInterface.php +++ b/dibi/libs/DibiDriverInterface.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/libs/DibiException.php b/dibi/libs/DibiException.php index dfe2e2c9..1bb34ce9 100644 --- a/dibi/libs/DibiException.php +++ b/dibi/libs/DibiException.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/libs/DibiLogger.php b/dibi/libs/DibiLogger.php index 374d271b..97cc2e66 100644 --- a/dibi/libs/DibiLogger.php +++ b/dibi/libs/DibiLogger.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/libs/DibiResult.php b/dibi/libs/DibiResult.php index f3ed25db..3f63f28a 100644 --- a/dibi/libs/DibiResult.php +++ b/dibi/libs/DibiResult.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/libs/DibiResultIterator.php b/dibi/libs/DibiResultIterator.php index cb226e6b..4ad206e5 100644 --- a/dibi/libs/DibiResultIterator.php +++ b/dibi/libs/DibiResultIterator.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/libs/DibiTranslator.php b/dibi/libs/DibiTranslator.php index c4303a27..13eae7f6 100644 --- a/dibi/libs/DibiTranslator.php +++ b/dibi/libs/DibiTranslator.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/libs/DibiVariable.php b/dibi/libs/DibiVariable.php index 4f02f7bb..8e29618a 100644 --- a/dibi/libs/DibiVariable.php +++ b/dibi/libs/DibiVariable.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2005, 2007 David Grudl - * @license http://php7.org/dibi/license dibi license - * @link http://php7.org/dibi/ + * @license http://dibiphp.com/license dibi license + * @link http://dibiphp.com/ * @package dibi */ diff --git a/dibi/libs/NClass.php b/dibi/libs/NClass.php index 46622cb0..6def7398 100644 --- a/dibi/libs/NClass.php +++ b/dibi/libs/NClass.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2004, 2007 David Grudl - * @license http://php7.org/nette/license Nette license - * @link http://php7.org/nette/ + * @license http://nettephp.com/license Nette license + * @link http://nettephp.com/ * @package Nette */ @@ -24,8 +24,8 @@ * * @author David Grudl * @copyright Copyright (c) 2004, 2007 David Grudl - * @license http://php7.org/nette/license Nette license - * @link http://php7.org/nette/ + * @license http://nettephp.com/license Nette license + * @link http://nettephp.com/ * @package Nette */ abstract class NClass diff --git a/dibi/libs/NException.php b/dibi/libs/NException.php index d27b6ca5..3dd7291f 100644 --- a/dibi/libs/NException.php +++ b/dibi/libs/NException.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2004, 2007 David Grudl - * @license http://php7.org/nette/license Nette license - * @link http://php7.org/nette/ + * @license http://nettephp.com/license Nette license + * @link http://nettephp.com/ * @package Nette */ @@ -24,8 +24,8 @@ * * @author David Grudl * @copyright Copyright (c) 2004, 2007 David Grudl - * @license http://php7.org/nette/license Nette license - * @link http://php7.org/nette/ + * @license http://nettephp.com/license Nette license + * @link http://nettephp.com/ * @package Nette */ class NException extends Exception diff --git a/dibi/libs/NObject.php b/dibi/libs/NObject.php index 54f95f7f..9ea33b4a 100644 --- a/dibi/libs/NObject.php +++ b/dibi/libs/NObject.php @@ -9,11 +9,11 @@ * This source file is subject to the "dibi license" that is bundled * with this package in the file license.txt. * - * For more information please see http://php7.org/dibi/ + * For more information please see http://dibiphp.com/ * * @copyright Copyright (c) 2004, 2007 David Grudl - * @license http://php7.org/nette/license Nette license - * @link http://php7.org/nette/ + * @license http://nettephp.com/license Nette license + * @link http://nettephp.com/ * @package Nette */ @@ -47,8 +47,8 @@ * * @author David Grudl * @copyright Copyright (c) 2004, 2007 David Grudl - * @license http://php7.org/nette/license Nette license - * @link http://php7.org/nette/ + * @license http://nettephp.com/license Nette license + * @link http://nettephp.com/ * @package Nette */ abstract class NObject diff --git a/examples/sample.mdb b/examples/sample.mdb index 554e6a69..1185a92e 100644 Binary files a/examples/sample.mdb and b/examples/sample.mdb differ diff --git a/examples/sample.sdb b/examples/sample.sdb index 02f4cbe0..7ab9393b 100644 Binary files a/examples/sample.sdb and b/examples/sample.sdb differ diff --git a/icons/example.html b/icons/example.html index 9ae47d54..80cfd835 100644 --- a/icons/example.html +++ b/icons/example.html @@ -1,2 +1,2 @@ -dibi powered diff --git a/readme.txt b/readme.txt index 8dc1bb63..9c4d75f7 100644 --- a/readme.txt +++ b/readme.txt @@ -21,7 +21,7 @@ Documentation and Examples Refer to the 'examples' directory for examples. Dibi documentation is available on the homepage: -http://php7.org/dibi/ +http://dibiphp.com @@ -38,4 +38,4 @@ whitespaces are removed. ----- For more information, visit the author's weblog (in czech language): -http://latrine.dgx.cz/ +http://latrine.dgx.cz