This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via 016c73dc5aa3f4b207f81f465f646fd5282b617e (commit)
from 05d5cc1d8028fa113adc899eb739308dee395b43 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 016c73dc5aa3f4b207f81f465f646fd5282b617e
Author: Ivan Borzenkov <iva...@li...>
Date: Fri Apr 15 00:25:09 2011 +0400
Обновлена DbSimple
diff --git a/lib/DbSimple/Connect.php b/lib/DbSimple/Connect.php
index 17fc5e7..719793a 100644
--- a/lib/DbSimple/Connect.php
+++ b/lib/DbSimple/Connect.php
@@ -42,6 +42,10 @@ class DbSimple_Connect
protected $shema;
/** @var array Что выставить при коннекте */
protected $init;
+ /** @var integer код ошибки */
+ public $error = null;
+ /** @var string сообщение об ошибке */
+ public $errmsg = null;
/**
* Конструктор только запоминает переданный DSN
@@ -117,6 +121,8 @@ class DbSimple_Connect
require_once dirname(__FILE__).'/'.$this->shema.'.php';
$class = 'DbSimple_'.$this->shema;
$this->DbSimple = new $class($parsed);
+ $this->errmsg = &$this->DbSimple->errmsg;
+ $this->error = &$this->DbSimple->error;
if (isset($parsed['prefix']))
$this->DbSimple->setIdentPrefix($parsed['prefix']);
if ($this->_cachePrefix) $this->DbSimple->setCachePrefix($this->_cachePrefix);
diff --git a/lib/DbSimple/Database.php b/lib/DbSimple/Database.php
index 112b444..e205ae2 100644
--- a/lib/DbSimple/Database.php
+++ b/lib/DbSimple/Database.php
@@ -1302,7 +1302,7 @@ abstract class DbSimple_LastError
$this->errorHandler = $handler;
// In case of setting first error handler for already existed
// error - call the handler now (usual after connect()).
- if (!$prev && $this->error) {
+ if (!$prev && $this->error && $this->errorHandler) {
call_user_func($this->errorHandler, $this->errmsg, $this->error);
}
return $prev;
diff --git a/lib/DbSimple/Generic.php b/lib/DbSimple/Generic.php
index 43dbe14..8cc9203 100644
--- a/lib/DbSimple/Generic.php
+++ b/lib/DbSimple/Generic.php
@@ -86,7 +86,7 @@ class DbSimple_Generic
* Choose database driver according to DSN. Return new instance
* of this driver.
*/
- function& connect($dsn)
+ function connect($dsn)
{
// Load database driver and create its instance.
$parsed = DbSimple_Generic::parseDSN($dsn);
@@ -96,24 +96,15 @@ class DbSimple_Generic
}
$class = 'DbSimple_'.ucfirst($parsed['scheme']);
if (!class_exists($class)) {
- $file = str_replace('_', '/', $class) . ".php";
- // Try to load library file from standard include_path.
- if ($f = @fopen($file, "r", true)) {
- fclose($f);
+ $file = dirname(__FILE__).'/'.ucfirst($parsed['scheme']). ".php";
+ if (is_file($file)) {
require_once($file);
} else {
- // Wrong include_path; try to load from current directory.
- $base = basename($file);
- $dir = dirname(__FILE__);
- if (@is_file($path = "$dir/$base")) {
- require_once($path);
- } else {
- trigger_error("Error loading database driver: no file $file in include_path; no file $base in $dir", E_USER_ERROR);
- return null;
- }
+ trigger_error("Error loading database driver: no file $file", E_USER_ERROR);
+ return null;
}
}
- $object =& new $class($parsed);
+ $object = new $class($parsed);
if (isset($parsed['ident_prefix'])) {
$object->setIdentPrefix($parsed['ident_prefix']);
}
@@ -130,7 +121,7 @@ class DbSimple_Generic
function parseDSN($dsn)
{
if (is_array($dsn)) return $dsn;
- $parsed = @parse_url($dsn);
+ $parsed = parse_url($dsn);
if (!$parsed) return null;
$params = null;
if (!empty($parsed['query'])) {
diff --git a/lib/DbSimple/Ibase.php b/lib/DbSimple/Ibase.php
index 8fe15a0..6fb6e66 100644
--- a/lib/DbSimple/Ibase.php
+++ b/lib/DbSimple/Ibase.php
@@ -77,7 +77,7 @@ class DbSimple_Ibase extends DbSimple_Database
$this->trans = @ibase_trans($parameters, $this->link);
}
- function& _performNewBlob($blobid=null)
+ function _performNewBlob($blobid=null)
{
return new DbSimple_Ibase_Blob($this, $blobid);
}
-----------------------------------------------------------------------
Summary of changes:
lib/DbSimple/Connect.php | 6 ++++++
lib/DbSimple/Database.php | 2 +-
lib/DbSimple/Generic.php | 23 +++++++----------------
lib/DbSimple/Ibase.php | 2 +-
4 files changed, 15 insertions(+), 18 deletions(-)
hooks/post-receive
--
quickfw
|