[PHP-CVS] cvs: php-src /ext/pdo_sqlite pdo_sqlite.c php_pdo_sqlite.h php_pdo_sqlite_int.h sqlite_driver.c sqlite_statement.c
wez Fri Dec 15 05:03:03 2006 UTC Modified files: /php-src/ext/pdo_sqlite pdo_sqlite.c php_pdo_sqlite.h php_pdo_sqlite_int.h sqlite_driver.c sqlite_statement.c Log: merge php5 pdo_sqlite into head; this source compiles on both php5 and php6. http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/pdo_sqlite.c?r1=1.13&r2=1.14&diff_format=u Index: php-src/ext/pdo_sqlite/pdo_sqlite.c diff -u php-src/ext/pdo_sqlite/pdo_sqlite.c:1.13 php-src/ext/pdo_sqlite/pdo_sqlite.c:1.14 --- php-src/ext/pdo_sqlite/pdo_sqlite.c:1.13Sun Jan 1 13:09:53 2006 +++ php-src/ext/pdo_sqlite/pdo_sqlite.c Fri Dec 15 05:03:02 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: pdo_sqlite.c,v 1.13 2006/01/01 13:09:53 sniper Exp $ */ +/* $Id: pdo_sqlite.c,v 1.14 2006/12/15 05:03:02 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -31,7 +31,7 @@ #include "php_pdo_sqlite_int.h" #include "zend_exceptions.h" -#define PHP_PDO_SQLITE_MODULE_VERSION "0.9" +#define PHP_PDO_SQLITE_MODULE_VERSION "1.0.1" /* {{{ pdo_sqlite_functions[] */ zend_function_entry pdo_sqlite_functions[] = { @@ -100,7 +100,7 @@ "(bundled) " #endif PHP_PDO_SQLITE_MODULE_VERSION - " $Id: pdo_sqlite.c,v 1.13 2006/01/01 13:09:53 sniper Exp $"); + " $Id: pdo_sqlite.c,v 1.14 2006/12/15 05:03:02 wez Exp $"); php_info_print_table_row(2, "SQLite Library", sqlite3_libversion()); php_info_print_table_end(); } http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/php_pdo_sqlite.h?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/pdo_sqlite/php_pdo_sqlite.h diff -u php-src/ext/pdo_sqlite/php_pdo_sqlite.h:1.3 php-src/ext/pdo_sqlite/php_pdo_sqlite.h:1.4 --- php-src/ext/pdo_sqlite/php_pdo_sqlite.h:1.3 Sun Jan 1 13:09:53 2006 +++ php-src/ext/pdo_sqlite/php_pdo_sqlite.h Fri Dec 15 05:03:02 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pdo_sqlite.h,v 1.3 2006/01/01 13:09:53 sniper Exp $ */ +/* $Id: php_pdo_sqlite.h,v 1.4 2006/12/15 05:03:02 wez Exp $ */ #ifndef PHP_PDO_SQLITE_H http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h diff -u php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:1.4 php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:1.5 --- php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h:1.4 Sun Jan 1 13:09:53 2006 +++ php-src/ext/pdo_sqlite/php_pdo_sqlite_int.h Fri Dec 15 05:03:02 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pdo_sqlite_int.h,v 1.4 2006/01/01 13:09:53 sniper Exp $ */ +/* $Id: php_pdo_sqlite_int.h,v 1.5 2006/12/15 05:03:02 wez Exp $ */ #ifndef PHP_PDO_SQLITE_INT_H #define PHP_PDO_SQLITE_INT_H @@ -62,8 +62,13 @@ extern pdo_driver_t pdo_sqlite_driver; extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC); -#define pdo_sqlite_error(s) _pdo_sqlite_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC) +extern int _pdo_sqlite_error_msg(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *msg, + const char *file, int line TSRMLS_DC); +#define pdo_sqlite_error(dbh) _pdo_sqlite_error(dbh, NULL, __FILE__, __LINE__ TSRMLS_CC) +#define pdo_sqlite_errmsg(dbh, st, msg) _pdo_sqlite_error_msg(dbh, NULL, st, msg, __FILE__, __LINE__ TSRMLS_CC) +#define pdo_sqlite_error_stmt(stmt) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC) +#define pdo_sqlite_errmsg_stmt(stmt, st, msg) _pdo_sqlite_error_msg(stmt->dbh, stmt, st, msg, __FILE__, __LINE__ TSRMLS_CC) + extern struct pdo_stmt_methods sqlite_stmt_methods; #endif http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/sqlite_driver.c?r1=1.31&r2=1.32&diff_format=u Index: php-src/ext/pdo_sqlite/sqlite_driver.c diff -u php-src/ext/pdo_sqlite/sqlite_driver.c:1.31 php-src/ext/pdo_sqlite/sqlite_driver.c:1.32 --- php-src/ext/pdo_sqlite/sqlite_driver.c:1.31 Sun Dec 10 02:32:17 2006 +++ php-src/ext/pdo_sqlite/sqlite_driver.c Fri Dec 15 05:03:02 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: sqlite_driver.c,v 1.31 2006/12/10 02:32:17 pajoye Exp $ */ +/* $Id: sqlite_driver.c,v 1.32 2006/12/15 05:03:02 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -31,6 +31,30 @@ #include "php_pdo_sqlite_int.h" #include "zend_exceptions.h" +int _pdo_sqlite_error_msg(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *msg, + const char *file, int line TSRMLS_DC) +{ + pdo_sqlite_db_handle *H = (p
[PHP-CVS] cvs: php-src(PHP_5_2) / configure.in /main php_version.h
iliaa Fri Dec 15 01:22:35 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main php_version.h /php-srcconfigure.in Log: back to dev http://cvs.php.net/viewvc.cgi/php-src/main/php_version.h?r1=1.112.2.37.2.18&r2=1.112.2.37.2.19&diff_format=u Index: php-src/main/php_version.h diff -u php-src/main/php_version.h:1.112.2.37.2.18 php-src/main/php_version.h:1.112.2.37.2.19 --- php-src/main/php_version.h:1.112.2.37.2.18 Fri Dec 15 01:21:36 2006 +++ php-src/main/php_version.h Fri Dec 15 01:22:35 2006 @@ -3,6 +3,6 @@ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 2 #define PHP_RELEASE_VERSION 1 -#define PHP_EXTRA_VERSION "RC1" -#define PHP_VERSION "5.2.1RC1" +#define PHP_EXTRA_VERSION "RC2-dev" +#define PHP_VERSION "5.2.1RC2-dev" #define PHP_VERSION_ID 50201 http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.579.2.52.2.31&r2=1.579.2.52.2.32&diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.579.2.52.2.31 php-src/configure.in:1.579.2.52.2.32 --- php-src/configure.in:1.579.2.52.2.31Fri Dec 15 01:21:36 2006 +++ php-src/configure.inFri Dec 15 01:22:35 2006 @@ -1,4 +1,4 @@ - ## $Id: configure.in,v 1.579.2.52.2.31 2006/12/15 01:21:36 iliaa Exp $ -*- autoconf -*- + ## $Id: configure.in,v 1.579.2.52.2.32 2006/12/15 01:22:35 iliaa Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -44,7 +44,7 @@ MAJOR_VERSION=5 MINOR_VERSION=2 RELEASE_VERSION=1 -EXTRA_VERSION="RC1" +EXTRA_VERSION="RC2-dev" PHP_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION" PHP_VERSION_ID=`expr [$]MAJOR_VERSION \* 1 + [$]MINOR_VERSION \* 100 + [$]RELEASE_VERSION` -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS configure.in /main php_version.h
iliaa Fri Dec 15 01:21:36 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS configure.in /php-src/main php_version.h Log: 5.2.1RC1 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.429&r2=1.2027.2.547.2.430&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.429 php-src/NEWS:1.2027.2.547.2.430 --- php-src/NEWS:1.2027.2.547.2.429 Wed Dec 13 15:45:20 2006 +++ php-src/NEWSFri Dec 15 01:21:36 2006 @@ -1,6 +1,6 @@ PHPNEWS ||| -?? ??? 2007, PHP 5.2.1 +14 Dec 2006, PHP 5.2.1RC1 - Added a meta tag to phpinfo() output to prevent search engines from indexing the page. (Ilia) - Added new function, sys_get_temp_dir(). (Hartmut) http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.579.2.52.2.30&r2=1.579.2.52.2.31&diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.579.2.52.2.30 php-src/configure.in:1.579.2.52.2.31 --- php-src/configure.in:1.579.2.52.2.30Tue Dec 12 07:38:04 2006 +++ php-src/configure.inFri Dec 15 01:21:36 2006 @@ -1,4 +1,4 @@ - ## $Id: configure.in,v 1.579.2.52.2.30 2006/12/12 07:38:04 tony2001 Exp $ -*- autoconf -*- + ## $Id: configure.in,v 1.579.2.52.2.31 2006/12/15 01:21:36 iliaa Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -44,7 +44,7 @@ MAJOR_VERSION=5 MINOR_VERSION=2 RELEASE_VERSION=1 -EXTRA_VERSION="-dev" +EXTRA_VERSION="RC1" PHP_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION" PHP_VERSION_ID=`expr [$]MAJOR_VERSION \* 1 + [$]MINOR_VERSION \* 100 + [$]RELEASE_VERSION` http://cvs.php.net/viewvc.cgi/php-src/main/php_version.h?r1=1.112.2.37.2.17&r2=1.112.2.37.2.18&diff_format=u Index: php-src/main/php_version.h diff -u php-src/main/php_version.h:1.112.2.37.2.17 php-src/main/php_version.h:1.112.2.37.2.18 --- php-src/main/php_version.h:1.112.2.37.2.17 Fri Nov 3 19:03:25 2006 +++ php-src/main/php_version.h Fri Dec 15 01:21:36 2006 @@ -3,6 +3,6 @@ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 2 #define PHP_RELEASE_VERSION 1 -#define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "5.2.1-dev" +#define PHP_EXTRA_VERSION "RC1" +#define PHP_VERSION "5.2.1RC1" #define PHP_VERSION_ID 50201 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard var_unserializer.c var_unserializer.re
andrei Fri Dec 15 00:58:08 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard var_unserializer.c var_unserializer.re Log: Support for 'S' format in unserialize() (forward compatibility with PHP 6) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.70.2.4&r2=1.70.2.4.2.1&diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.70.2.4 php-src/ext/standard/var_unserializer.c:1.70.2.4.2.1 --- php-src/ext/standard/var_unserializer.c:1.70.2.4Sun Jan 1 12:50:16 2006 +++ php-src/ext/standard/var_unserializer.c Fri Dec 15 00:58:08 2006 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.9.11 on Sun Jan 1 14:39:32 2006 */ +/* Generated by re2c 0.9.12 on Thu Dec 14 15:59:31 2006 */ #line 1 "ext/standard/var_unserializer.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.70.2.4 2006/01/01 12:50:16 sniper Exp $ */ +/* $Id: var_unserializer.c,v 1.70.2.4.2.1 2006/12/15 00:58:08 andrei Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -140,6 +140,38 @@ /* }}} */ +static char *unserialize_str(const unsigned char **p, int len) +{ + int i, j; + char *str = emalloc(len+1); + + for (i = 0; i < len; i++) { + if (**p != '\\') { + str[i] = (char)**p; + } else { + unsigned char ch = 0; + + for (j = 0; j < 2; j++) { + (*p)++; + if (**p >= '0' && **p <= '9') { + ch = (ch << 4) + (**p -'0'); + } else if (**p >= 'a' && **p <= 'f') { + ch = (ch << 4) + (**p -'a'+10); + } else if (**p >= 'A' && **p <= 'F') { + ch = (ch << 4) + (**p -'A'+10); + } else { + efree(str); + return NULL; + } + } + str[i] = (char)ch; + } + (*p)++; + } + str[i] = 0; + return str; +} + #define YYFILL(n) do { } while (0) #define YYCTYPE unsigned char #define YYCURSOR cursor @@ -147,7 +179,7 @@ #define YYMARKER marker -#line 155 "ext/standard/var_unserializer.re" +#line 187 "ext/standard/var_unserializer.re" @@ -390,7 +422,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, }; -#line 394 "ext/standard/var_unserializer.c" +#line 426 "ext/standard/var_unserializer.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -400,105 +432,110 @@ if((YYLIMIT - YYCURSOR) < 7) YYFILL(7); yych = *YYCURSOR; switch(yych){ - case 'C': case 'O': goto yy12; + case 'C': case 'O': goto yy13; case 'N': goto yy5; case 'R': goto yy2; - case 'a': goto yy10; + case 'S': goto yy10; + case 'a': goto yy11; case 'b': goto yy6; case 'd': goto yy8; case 'i': goto yy7; - case 'o': goto yy11; + case 'o': goto yy12; case 'r': goto yy4; case 's': goto yy9; - case '}': goto yy13; - default:goto yy15; + case '}': goto yy14; + default:goto yy16; } yy2: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy87; + if(yych == ':') goto yy95; goto yy3; yy3: -#line 626 "ext/standard/var_unserializer.re" +#line 687 "ext/standard/var_unserializer.re" { return 0; } -#line 424 "ext/standard/var_unserializer.c" +#line 457 "ext/standard/var_unserializer.c" yy4: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy81; + if(yych == ':') goto yy89; goto yy3; yy5: yych = *++YYCURSOR; - if(yych == ';') goto yy79; + if(yych == ';') goto yy87; goto yy3; yy6: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy75; + if(yych == ':') goto yy83; goto yy3; yy7: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy69; + if(yych == ':') goto yy77; goto yy3; yy8: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy45; + if(yych == ':') goto yy53; goto yy3; yy9: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy38; + if(yych == ':') goto yy46; goto yy3; yy10: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); -
[PHP-CVS] cvs: php-src /ext/standard var.c var_unserializer.c var_unserializer.re
andrei Thu Dec 14 23:41:57 2006 UTC Modified files: /php-src/ext/standard var.c var_unserializer.c var_unserializer.re Log: Use 'S' for escaped binary strings and 's' for non-escaped. http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var.c?r1=1.251&r2=1.252&diff_format=u Index: php-src/ext/standard/var.c diff -u php-src/ext/standard/var.c:1.251 php-src/ext/standard/var.c:1.252 --- php-src/ext/standard/var.c:1.251Fri Dec 8 21:18:16 2006 +++ php-src/ext/standard/var.c Thu Dec 14 23:41:57 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var.c,v 1.251 2006/12/08 21:18:16 tony2001 Exp $ */ +/* $Id: var.c,v 1.252 2006/12/14 23:41:57 andrei Exp $ */ @@ -718,7 +718,7 @@ unsigned char c; int i; - smart_str_appendl(buf, "s:", 2); + smart_str_appendl(buf, "S:", 2); smart_str_append_long(buf, len); smart_str_appendl(buf, ":\"", 2); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.81&r2=1.82&diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.81 php-src/ext/standard/var_unserializer.c:1.82 --- php-src/ext/standard/var_unserializer.c:1.81Fri Dec 1 19:25:11 2006 +++ php-src/ext/standard/var_unserializer.c Thu Dec 14 23:41:57 2006 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.9.12 on Fri Dec 1 11:18:14 2006 */ +/* Generated by re2c 0.9.12 on Thu Dec 14 15:32:34 2006 */ #line 1 "ext/standard/var_unserializer.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.81 2006/12/01 19:25:11 andrei Exp $ */ +/* $Id: var_unserializer.c,v 1.82 2006/12/14 23:41:57 andrei Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -468,110 +468,115 @@ if((YYLIMIT - YYCURSOR) < 7) YYFILL(7); yych = *YYCURSOR; switch(yych){ - case 'C': case 'O': goto yy13; + case 'C': case 'O': goto yy14; case 'N': goto yy5; case 'R': goto yy2; - case 'U': goto yy10; - case 'a': goto yy11; + case 'S': goto yy10; + case 'U': goto yy11; + case 'a': goto yy12; case 'b': goto yy6; case 'd': goto yy8; case 'i': goto yy7; - case 'o': goto yy12; + case 'o': goto yy13; case 'r': goto yy4; case 's': goto yy9; - case '}': goto yy14; - default:goto yy16; + case '}': goto yy15; + default:goto yy17; } yy2: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy95; + if(yych == ':') goto yy103; goto yy3; yy3: -#line 725 "ext/standard/var_unserializer.re" +#line 753 "ext/standard/var_unserializer.re" { return 0; } -#line 493 "ext/standard/var_unserializer.c" +#line 494 "ext/standard/var_unserializer.c" yy4: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy89; + if(yych == ':') goto yy97; goto yy3; yy5: yych = *++YYCURSOR; - if(yych == ';') goto yy87; + if(yych == ';') goto yy95; goto yy3; yy6: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy83; + if(yych == ':') goto yy91; goto yy3; yy7: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy77; + if(yych == ':') goto yy85; goto yy3; yy8: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy53; + if(yych == ':') goto yy61; goto yy3; yy9: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy46; + if(yych == ':') goto yy54; goto yy3; yy10: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy39; + if(yych == ':') goto yy47; goto yy3; yy11: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy32; + if(yych == ':') goto yy40; goto yy3; yy12: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy25; + if(yych == ':') goto yy33; goto yy3; yy13: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy17; + if(yych == ':') goto yy26; goto yy3; -yy14: ++YYCURSOR; - goto yy15; -yy15: -#line 719 "ext/standard/var_unserializer.re" +yy14: yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if(yych == ':') goto yy18; + goto yy3; +yy15: ++YYCURSOR; + goto yy16; +yy16: +#line 747 "ext/standard/var_unserializer.re" { /* this is the case where we have less da
[PHP-CVS] cvs: CVSROOT / avail
mj Thu Dec 14 20:46:49 2006 UTC Modified files: /CVSROOTavail Log: * Karma for Justin Patrin http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1220&r2=1.1221&diff_format=u Index: CVSROOT/avail diff -u CVSROOT/avail:1.1220 CVSROOT/avail:1.1221 --- CVSROOT/avail:1.1220Wed Dec 13 17:14:48 2006 +++ CVSROOT/avail Thu Dec 14 20:46:48 2006 @@ -271,7 +271,7 @@ avail|jstump,cyberscribe|pear/Payment_Process avail|johannes|pecl/idn avail|jimi|smbc -avail|justinpatrin|pear/DB_DataObject_FormBuilder,pear/MDB2 +avail|justinpatrin|pear/DB_DataObject_FormBuilder,pear/MDB2,pear/HTML_QuickForm_ElementGrid avail|schst,luckec|pecl/id3 avail|gabe,jlesueur|pecl/zeroconf avail|curt|pecl/postparser -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/dom dom_fe.h php_dom.c php_dom.h xpath.c /ext/dom/tests domxpath.phpt
rrichards Thu Dec 14 16:24:00 2006 UTC Modified files: /php-src/ext/domdom_fe.h php_dom.c php_dom.h xpath.c /php-src/ext/dom/tests domxpath.phpt Log: add ability to call PHP functions from XPath update test http://cvs.php.net/viewvc.cgi/php-src/ext/dom/dom_fe.h?r1=1.18&r2=1.19&diff_format=u Index: php-src/ext/dom/dom_fe.h diff -u php-src/ext/dom/dom_fe.h:1.18 php-src/ext/dom/dom_fe.h:1.19 --- php-src/ext/dom/dom_fe.h:1.18 Sun Jul 16 15:05:32 2006 +++ php-src/ext/dom/dom_fe.hThu Dec 14 16:24:00 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: dom_fe.h,v 1.18 2006/07/16 15:05:32 chregu Exp $ */ +/* $Id: dom_fe.h,v 1.19 2006/12/14 16:24:00 rrichards Exp $ */ #ifndef DOM_FE_H #define DOM_FE_H @@ -264,6 +264,7 @@ PHP_FUNCTION(dom_xpath_register_ns); PHP_FUNCTION(dom_xpath_query); PHP_FUNCTION(dom_xpath_evaluate); +PHP_FUNCTION(dom_xpath_register_php_functions); #endif #endif /* DOM_FE_H */ http://cvs.php.net/viewvc.cgi/php-src/ext/dom/php_dom.c?r1=1.100&r2=1.101&diff_format=u Index: php-src/ext/dom/php_dom.c diff -u php-src/ext/dom/php_dom.c:1.100 php-src/ext/dom/php_dom.c:1.101 --- php-src/ext/dom/php_dom.c:1.100 Fri Nov 17 10:48:53 2006 +++ php-src/ext/dom/php_dom.c Thu Dec 14 16:24:00 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_dom.c,v 1.100 2006/11/17 10:48:53 dmitry Exp $ */ +/* $Id: php_dom.c,v 1.101 2006/12/14 16:24:00 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -921,7 +921,7 @@ /* {{{ dom_xpath_objects_free_storage */ void dom_xpath_objects_free_storage(void *object TSRMLS_DC) { - dom_object *intern = (dom_object *)object; + dom_xpath_object *intern = (dom_xpath_object *)object; zend_object_std_dtor(&intern->std TSRMLS_CC); @@ -931,6 +931,14 @@ intern->ptr = NULL; } + zend_hash_destroy(intern->registered_phpfunctions); + FREE_HASHTABLE(intern->registered_phpfunctions); + + if (intern->node_list) { + zend_hash_destroy(intern->node_list); + FREE_HASHTABLE(intern->node_list); + } + efree(object); } /* }}} */ @@ -987,7 +995,12 @@ zval *tmp; dom_object *intern; - intern = emalloc(sizeof(dom_object)); + if (instanceof_function(class_type, dom_xpath_class_entry TSRMLS_CC)) { + intern = emalloc(sizeof(dom_xpath_object)); + memset(intern, 0, sizeof(dom_xpath_object)); + } else { + intern = emalloc(sizeof(dom_object)); + } intern->ptr = NULL; intern->prop_handler = NULL; intern->document = NULL; @@ -1058,9 +1071,15 @@ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC) { zend_object_value retval; - dom_object *intern; + dom_xpath_object *intern; - intern = dom_objects_set_class(class_type, 1 TSRMLS_CC); + intern = (dom_xpath_object *)dom_objects_set_class(class_type, 1 TSRMLS_CC); + intern->registerPhpFunctions = 0; + intern->registered_phpfunctions = NULL; + intern->node_list = NULL; + + ALLOC_HASHTABLE(intern->registered_phpfunctions); + zend_u_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, dom_objects_clone TSRMLS_CC); intern->handle = retval.handle; http://cvs.php.net/viewvc.cgi/php-src/ext/dom/php_dom.h?r1=1.33&r2=1.34&diff_format=u Index: php-src/ext/dom/php_dom.h diff -u php-src/ext/dom/php_dom.h:1.33 php-src/ext/dom/php_dom.h:1.34 --- php-src/ext/dom/php_dom.h:1.33 Tue Jun 20 18:00:11 2006 +++ php-src/ext/dom/php_dom.h Thu Dec 14 16:24:00 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_dom.h,v 1.33 2006/06/20 18:00:11 bjori Exp $ */ +/* $Id: php_dom.h,v 1.34 2006/12/14 16:24:00 rrichards Exp $ */ #ifndef PHP_DOM_H #define PHP_DOM_H @@ -67,6 +67,17 @@ /* Define a custom type for iterating using an unused nodetype */ #define DOM_NODESET XML_XINCLUDE_START +typedef struct _dom_xpath_object { + zend_object std; + void *ptr; + php_libxml_ref_obj *document; + HashTable *prop_handler; + zend_object_handle handle; + int registerPhpFunctions; + HashTable *registered_phpfunctions; + HashTable *node_list; +} dom_xpath_object; + typedef struct _dom_nnodemap_object { dom_object *baseobj; int nodetype; http://cvs.php.net/viewvc.cgi/php-src/ext/dom/xpath.c?r1=1.32&r2=1.33&diff_format=u Index: php-src/ext/dom/xpath.c diff -u php-src/ext/dom/xpath.c:1.32 php-src/ext/dom/xpath.c