mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 14:16:39 +02:00
* fixed DibiPostgreDriver::insertId
* changed URL to http://dibiphp.com
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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']);
|
||||
}
|
||||
|
||||
|
@@ -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']);
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
<a href="http://php7.org/dibi/" title="dibi - tiny 'n' smart database abstraction layer"
|
||||
<a href="http://dibiphp.com" title="dibi - tiny 'n' smart database abstraction layer"
|
||||
><img src="dibi-powered.gif" width="80" height="15" alt="dibi powered" /></a>
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user