cvs: pear /DB/DB msql.php sqlite.php sybase.php

From: Date: Fri, 29 Dec 2006 05:56:54 +0000
Subject: cvs: pear /DB/DB msql.php sqlite.php sybase.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-43874@lists.php.net to get a copy of this message
aharvey Fri Dec 29 05:56:54 2006 UTC Modified files: /pear/DB/DB msql.php sqlite.php sybase.php Log: PHP 5.2 compatibility fix for bug #9599. http://cvs.php.net/viewvc.cgi/pear/DB/DB/msql.php?r1=1.57&r2=1.58&diff_format=u Index: pear/DB/DB/msql.php diff -u pear/DB/DB/msql.php:1.57 pear/DB/DB/msql.php:1.58 --- pear/DB/DB/msql.php:1.57 Tue Feb 22 07:26:46 2005 +++ pear/DB/DB/msql.php Fri Dec 29 05:56:54 2006 @@ -23,7 +23,7 @@ * @author Daniel Convissor <danielc@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: msql.php,v 1.57 2005/02/22 07:26:46 danielc Exp $ + * @version CVS: $Id: msql.php,v 1.58 2006/12/29 05:56:54 aharvey Exp $ * @link http://pear.php.net/package/DB */ @@ -598,6 +598,11 @@ function errorCode($errormsg) { static $error_regexps; + + // PHP 5.2+ prepends the function name to $php_errormsg, so we need + // this hack to work around it, per bug #9599. + $errormsg = preg_replace('/^msql[a-z_]+\(\): /', '', $errormsg); + if (!isset($error_regexps)) { $error_regexps = array( '/^Access to database denied/i' http://cvs.php.net/viewvc.cgi/pear/DB/DB/sqlite.php?r1=1.111&r2=1.112&diff_format=u Index: pear/DB/DB/sqlite.php diff -u pear/DB/DB/sqlite.php:1.111 pear/DB/DB/sqlite.php:1.112 --- pear/DB/DB/sqlite.php:1.111 Thu Dec 21 07:28:37 2006 +++ pear/DB/DB/sqlite.php Fri Dec 29 05:56:54 2006 @@ -21,7 +21,7 @@ * @author Daniel Convissor <danielc@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 - * @version CVS: $Id: sqlite.php,v 1.111 2006/12/21 07:28:37 tuupola Exp $ + * @version CVS: $Id: sqlite.php,v 1.112 2006/12/29 05:56:54 aharvey Exp $ * @link http://pear.php.net/package/DB */ @@ -728,8 +728,12 @@ */ function errorCode($errormsg) { - $errormsg = str_replace('sqlite_query(): ', '', $errormsg); static $error_regexps; + + // PHP 5.2+ prepends the function name to $php_errormsg, so we need + // this hack to work around it, per bug #9599. + $errormsg = preg_replace('/^sqlite[a-z_]+\(\): /', '', $errormsg); + if (!isset($error_regexps)) { $error_regexps = array( '/^no such table:/' => DB_ERROR_NOSUCHTABLE, http://cvs.php.net/viewvc.cgi/pear/DB/DB/sybase.php?r1=1.79&r2=1.80&diff_format=u Index: pear/DB/DB/sybase.php diff -u pear/DB/DB/sybase.php:1.79 pear/DB/DB/sybase.php:1.80 --- pear/DB/DB/sybase.php:1.79 Tue Jun 14 12:42:28 2005 +++ pear/DB/DB/sybase.php Fri Dec 29 05:56:54 2006 @@ -21,7 +21,7 @@ * @author Daniel Convissor <danielc@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: sybase.php,v 1.79 2005/06/14 12:42:28 danielc Exp $ + * @version CVS: $Id: sybase.php,v 1.80 2006/12/29 05:56:54 aharvey Exp $ * @link http://pear.php.net/package/DB */ @@ -642,6 +642,11 @@ function errorCode($errormsg) { static $error_regexps; + + // PHP 5.2+ prepends the function name to $php_errormsg, so we need + // this hack to work around it, per bug #9599. + $errormsg = preg_replace('/^sybase[a-z_]+\(\): /', '', $errormsg); + if (!isset($error_regexps)) { $error_regexps = array( '/Incorrect syntax near/'

« previous php.pear.cvs (#43874) next »