pajoye          Sun Dec 10 03:12:11 2006 UTC

  Modified files:              
    /php-src/ext/pdo_mysql      mysql_driver.c 
    /php-src/ext/pdo_oci        oci_driver.c 
    /php-src/ext/pdo_odbc       odbc_driver.c 
    /php-src/ext/sqlite pdo_sqlite2.c 
  Log:
  - build fix the other driver as well (a macro would be nicer)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.75&r2=1.76&diff_format=u
Index: php-src/ext/pdo_mysql/mysql_driver.c
diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.75 
php-src/ext/pdo_mysql/mysql_driver.c:1.76
--- php-src/ext/pdo_mysql/mysql_driver.c:1.75   Sun Dec  3 23:30:24 2006
+++ php-src/ext/pdo_mysql/mysql_driver.c        Sun Dec 10 03:12:11 2006
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysql_driver.c,v 1.75 2006/12/03 23:30:24 iliaa Exp $ */
+/* $Id: mysql_driver.c,v 1.76 2006/12/10 03:12:11 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -97,8 +97,13 @@
 #endif
 
        if (!dbh->methods) {
+#if PHP_VERSION_ID > 50200
+               zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, 
"SQLSTATE[%s] [%d] %s",
+                               *pdo_err, einfo->errcode, einfo->errmsg);
+#else
                zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 
TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
                                *pdo_err, einfo->errcode, einfo->errmsg);
+#endif
        }
 /* printf("** [%s:%d] %s %s\n", file, line, *pdo_err, einfo->errmsg); */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/oci_driver.c?r1=1.29&r2=1.30&diff_format=u
Index: php-src/ext/pdo_oci/oci_driver.c
diff -u php-src/ext/pdo_oci/oci_driver.c:1.29 
php-src/ext/pdo_oci/oci_driver.c:1.30
--- php-src/ext/pdo_oci/oci_driver.c:1.29       Sun Jan  1 13:09:53 2006
+++ php-src/ext/pdo_oci/oci_driver.c    Sun Dec 10 03:12:11 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: oci_driver.c,v 1.29 2006/01/01 13:09:53 sniper Exp $ */
+/* $Id: oci_driver.c,v 1.30 2006/12/10 03:12:11 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -158,7 +158,11 @@
 
        /* little mini hack so that we can use this code from the dbh ctor */
        if (!dbh->methods) {
+#if PHP_VERSION_ID > 50200
+               zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, 
"SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg);
+#else
                zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 
TSRMLS_CC, "SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg);
+#endif
        }
 
        return einfo->errcode;
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_odbc/odbc_driver.c?r1=1.28&r2=1.29&diff_format=u
Index: php-src/ext/pdo_odbc/odbc_driver.c
diff -u php-src/ext/pdo_odbc/odbc_driver.c:1.28 
php-src/ext/pdo_odbc/odbc_driver.c:1.29
--- php-src/ext/pdo_odbc/odbc_driver.c:1.28     Fri Aug 12 23:32:31 2005
+++ php-src/ext/pdo_odbc/odbc_driver.c  Sun Dec 10 03:12:11 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: odbc_driver.c,v 1.28 2005/08/12 23:32:31 wez Exp $ */
+/* $Id: odbc_driver.c,v 1.29 2006/12/10 03:12:11 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -87,8 +87,13 @@
        strcpy(*pdo_err, einfo->last_state);
 /* printf("@@ SQLSTATE[%s] %s\n", *pdo_err, einfo->last_err_msg); */
        if (!dbh->methods) {
+#if PHP_VERSION_ID > 50200
+               zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, 
"SQLSTATE[%s] %s: %d %s",
+                               *pdo_err, what, einfo->last_error, 
einfo->last_err_msg);
+#else
                zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 
TSRMLS_CC, "SQLSTATE[%s] %s: %d %s",
                                *pdo_err, what, einfo->last_error, 
einfo->last_err_msg);
+#endif
        }
 }
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/pdo_sqlite2.c?r1=1.12&r2=1.13&diff_format=u
Index: php-src/ext/sqlite/pdo_sqlite2.c
diff -u php-src/ext/sqlite/pdo_sqlite2.c:1.12 
php-src/ext/sqlite/pdo_sqlite2.c:1.13
--- php-src/ext/sqlite/pdo_sqlite2.c:1.12       Sat Sep 16 18:23:05 2006
+++ php-src/ext/sqlite/pdo_sqlite2.c    Sun Dec 10 03:12:11 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_sqlite2.c,v 1.12 2006/09/16 18:23:05 iliaa Exp $ */
+/* $Id: pdo_sqlite2.c,v 1.13 2006/12/10 03:12:11 pajoye Exp $ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -288,8 +288,13 @@
        }
 
        if (!dbh->methods) {
+#if PHP_VERSION_ID > 50200
+               zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, 
"SQLSTATE[%s] [%d] %s",
+                               *pdo_err, einfo->errcode, einfo->errmsg);
+#else
                zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 
TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
                                *pdo_err, einfo->errcode, einfo->errmsg);
+#endif
        }
 
        return einfo->errcode;
@@ -579,9 +584,15 @@
        filename = make_filename_safe(dbh->data_source TSRMLS_CC);
 
        if (!filename) {
+#if PHP_VERSION_ID > 50200
+               zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 
TSRMLS_CC,
+                               "open_basedir prohibits opening %s",
+                               dbh->data_source);
+#else
                zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 
TSRMLS_CC,
                                "open_basedir prohibits opening %s",
                                dbh->data_source);
+#endif
                goto cleanup;
        }
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to