[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog
changelog Wed Jul 28 20:36:09 2004 EDT Modified files: /ZendEngine2ChangeLog Log: ChangeLog update http://cvs.php.net/diff.php/ZendEngine2/ChangeLog?r1=1.511r2=1.512ty=u Index: ZendEngine2/ChangeLog diff -u ZendEngine2/ChangeLog:1.511 ZendEngine2/ChangeLog:1.512 --- ZendEngine2/ChangeLog:1.511 Tue Jul 27 20:34:08 2004 +++ ZendEngine2/ChangeLog Wed Jul 28 20:36:09 2004 @@ -1,3 +1,16 @@ +2004-07-28 Wez Furlong [EMAIL PROTECTED] + +* zend_ini.c: + Fix: ini entries for dl()'d modules now work under ZTS + Side-effect: avoid possible crashes when multiple threads load/unload + modules and mess with the global hash table. + +2004-07-28 Andi Gutmans [EMAIL PROTECTED] + +* zend.h + zend.h: + - Fix MAC OSX to always use native DSO loading + 2004-07-27 Marcus Boerger [EMAIL PROTECTED] * zend_exceptions.c: @@ -5127,7 +5140,7 @@ 2003-06-10 Jani Taskinen [EMAIL PROTECTED] * zend_multiply.h: - - Missing $Id: ChangeLog,v 1.511 2004/07/28 00:34:08 changelog Exp $ tag + - Missing $Id: ChangeLog,v 1.512 2004/07/29 00:36:09 changelog Exp $ tag 2003-06-10 James Cox [EMAIL PROTECTED] @@ -6851,7 +6864,7 @@ zend_types.h zend_variables.c zend_variables.h: - - Added some missing CVS $Id: ChangeLog,v 1.511 2004/07/28 00:34:08 changelog Exp $ tags, headers and footers. + - Added some missing CVS $Id: ChangeLog,v 1.512 2004/07/29 00:36:09 changelog Exp $ tags, headers and footers. 2003-01-30 Ilia Alshanetsky [EMAIL PROTECTED]
[PHP-CVS] cvs: php-src /sapi/activescript README classfactory.cpp scriptengine.cpp
wez Wed Jul 28 08:32:49 2004 EDT Modified files: /php-src/sapi/activescript README classfactory.cpp scriptengine.cpp Log: - Rename ProgID from ActivePHP (tm) to PHPScript (bah) - Convert line-endings for error messages to CRLF - Misc other tweaks http://cvs.php.net/diff.php/php-src/sapi/activescript/README?r1=1.5r2=1.6ty=u Index: php-src/sapi/activescript/README diff -u php-src/sapi/activescript/README:1.5 php-src/sapi/activescript/README:1.6 --- php-src/sapi/activescript/README:1.5Tue Jul 27 18:36:56 2004 +++ php-src/sapi/activescript/READMEWed Jul 28 08:32:49 2004 @@ -23,7 +23,7 @@ Configuration. == -ActivePHP will not use the default php.ini file. +PHPScript will not use the default php.ini file. Instead, it will look only in the same directory as the .exe that caused it to load. @@ -38,22 +38,22 @@ Create a .wsf file like this: job id=test -script language=ActivePHP5 +script language=PHPScript $WScript-Echo(Hello); /script /job o. ASP and ASP.NET - [EMAIL PROTECTED] % + [EMAIL PROTECTED] % % $Response-Write(Hello); % o. Windows Script Components / Behaviours - Use language=ActivePHP5 on your script tags + Use language=PHPScript on your script tags o. MS Scriptlet control - Set the language property to ActivePHP5 + Set the language property to PHPScript http://cvs.php.net/diff.php/php-src/sapi/activescript/classfactory.cpp?r1=1.11r2=1.12ty=u Index: php-src/sapi/activescript/classfactory.cpp diff -u php-src/sapi/activescript/classfactory.cpp:1.11 php-src/sapi/activescript/classfactory.cpp:1.12 --- php-src/sapi/activescript/classfactory.cpp:1.11 Mon Jul 26 23:57:31 2004 +++ php-src/sapi/activescript/classfactory.cpp Wed Jul 28 08:32:49 2004 @@ -15,7 +15,7 @@ | Authors: Wez Furlong [EMAIL PROTECTED] | +--+ */ -/* $Id: classfactory.cpp,v 1.11 2004/07/27 03:57:31 wez Exp $ */ +/* $Id: classfactory.cpp,v 1.12 2004/07/28 12:32:49 wez Exp $ */ /* IClassFactory Implementation, and DllXXX function implementation */ @@ -150,10 +150,10 @@ { HKEY_CLASSES_ROOT,CLSID\\[CLSID]\\InprocServer32, NULL, [MODULENAME] }, { HKEY_CLASSES_ROOT,CLSID\\[CLSID]\\InprocServer32, ThreadingModel, [THREADING] }, { HKEY_CLASSES_ROOT,CLSID\\[CLSID]\\OLEScript,NULL, NULL }, - { HKEY_CLASSES_ROOT,CLSID\\[CLSID]\\ProgID, NULL, ActivePHP5 }, - { HKEY_CLASSES_ROOT,ActivePHP5, NULL, ActivePHP5 }, - { HKEY_CLASSES_ROOT,ActivePHP5\\CLSID,NULL, [CLSID]}, - { HKEY_CLASSES_ROOT,ActivePHP5\\OLEScript,NULL, NULL}, + { HKEY_CLASSES_ROOT,CLSID\\[CLSID]\\ProgID, NULL, PHPScript }, + { HKEY_CLASSES_ROOT,PHPScript, NULL, PHPScript }, + { HKEY_CLASSES_ROOT,PHPScript\\CLSID, NULL, [CLSID]}, + { HKEY_CLASSES_ROOT,PHPScript\\OLEScript, NULL, NULL}, { 0, NULL, NULL, NULL } }; http://cvs.php.net/diff.php/php-src/sapi/activescript/scriptengine.cpp?r1=1.14r2=1.15ty=u Index: php-src/sapi/activescript/scriptengine.cpp diff -u php-src/sapi/activescript/scriptengine.cpp:1.14 php-src/sapi/activescript/scriptengine.cpp:1.15 --- php-src/sapi/activescript/scriptengine.cpp:1.14 Tue Jul 27 18:36:56 2004 +++ php-src/sapi/activescript/scriptengine.cpp Wed Jul 28 08:32:49 2004 @@ -15,7 +15,7 @@ | Authors: Wez Furlong [EMAIL PROTECTED] | +--+ */ -/* $Id: scriptengine.cpp,v 1.14 2004/07/27 22:36:56 wez Exp $ */ +/* $Id: scriptengine.cpp,v 1.15 2004/07/28 12:32:49 wez Exp $ */ /* Implementation Notes: * @@ -419,7 +419,7 @@ int i; for (i = 0; i m_ids; i++) { if (!strcasecmp(m_names[i], aname.ansi_string())) { - trace(already had this ID\n); + trace(already had ID %d for %s\n, i, m_names[i]); return i; } } @@ -764,7 +764,7 @@ pv.value.str.val = frag-code; pv.value.str.len = frag-codelen; - frag-opcodes = compile_string(pv, fragment (JIT) TSRMLS_CC); + frag-opcodes = compile_string(pv, fragment TSRMLS_CC); if (!frag-opcodes) { trace(***
[PHP-CVS] cvs: php-src /sapi/activescript CREDITS EXPERIMENTAL README classfactory.cpp config.w32 marshal.cpp php5activescript.c php5activescript.def php5activescript.dsp php5activescript.h php5as_classfactory.h php5as_scriptengine.h scriptengine.cpp
wez Wed Jul 28 08:35:53 2004 EDT Removed files: /php-src/sapi/activescript CREDITS EXPERIMENTAL README classfactory.cpp config.w32 marshal.cpp php5activescript.c php5activescript.def php5activescript.dsp php5activescript.h php5as_classfactory.h php5as_scriptengine.h scriptengine.cpp Log: Move activescript sapi to PECL -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS /ext/xsl php_xsl.c php_xsl.h xsltprocessor.c
chregu Wed Jul 28 08:40:53 2004 EDT Modified files: /php-srcNEWS /php-src/ext/xslphp_xsl.c php_xsl.h xsltprocessor.c Log: Fix for bug #29409 (Segfault in PHP functions called from XSLT). (by Rob) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1777r2=1.1778ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1777 php-src/NEWS:1.1778 --- php-src/NEWS:1.1777 Mon Jul 26 03:18:58 2004 +++ php-src/NEWSWed Jul 28 08:40:53 2004 @@ -1,6 +1,7 @@ PHPNEWS ||| ?? ??? 2004, PHP 5.1.0 +- Fixed bug #29409 (Segfault in PHP functions called from XSLT). (Rob) - Fixed bug #29335 (fetch functions now use MYSQLI_BOTH as default) (Georg) - Fixed bug #29311 (calling parent constructor in mysqli). (Georg) - Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry) http://cvs.php.net/diff.php/php-src/ext/xsl/php_xsl.c?r1=1.23r2=1.24ty=u Index: php-src/ext/xsl/php_xsl.c diff -u php-src/ext/xsl/php_xsl.c:1.23 php-src/ext/xsl/php_xsl.c:1.24 --- php-src/ext/xsl/php_xsl.c:1.23 Sun Jul 25 04:37:39 2004 +++ php-src/ext/xsl/php_xsl.c Wed Jul 28 08:40:53 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xsl.c,v 1.23 2004/07/25 08:37:39 chregu Exp $ */ +/* $Id: php_xsl.c,v 1.24 2004/07/28 12:40:53 chregu Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -132,6 +132,11 @@ zend_hash_destroy(intern-parameter); FREE_HASHTABLE(intern-parameter); + if (intern-node_list) { + zend_hash_destroy(intern-node_list); + FREE_HASHTABLE(intern-node_list); + } + if (intern-ptr) { /* free wrapper */ if (((xsltStylesheetPtr) intern-ptr)-_private != NULL) { @@ -160,6 +165,7 @@ intern-parameter = NULL; intern-hasKeys = 0; intern-registerPhpFunctions = 0; + intern-node_list = NULL; ALLOC_HASHTABLE(intern-std.properties); zend_hash_init(intern-std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); http://cvs.php.net/diff.php/php-src/ext/xsl/php_xsl.h?r1=1.10r2=1.11ty=u Index: php-src/ext/xsl/php_xsl.h diff -u php-src/ext/xsl/php_xsl.h:1.10 php-src/ext/xsl/php_xsl.h:1.11 --- php-src/ext/xsl/php_xsl.h:1.10 Wed Feb 4 06:14:47 2004 +++ php-src/ext/xsl/php_xsl.h Wed Jul 28 08:40:53 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xsl.h,v 1.10 2004/02/04 11:14:47 zeev Exp $ */ +/* $Id: php_xsl.h,v 1.11 2004/07/28 12:40:53 chregu Exp $ */ #ifndef PHP_XSL_H #define PHP_XSL_H @@ -57,6 +57,7 @@ HashTable *parameter; int hasKeys; int registerPhpFunctions; + HashTable *node_list; } xsl_object; void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC); http://cvs.php.net/diff.php/php-src/ext/xsl/xsltprocessor.c?r1=1.29r2=1.30ty=u Index: php-src/ext/xsl/xsltprocessor.c diff -u php-src/ext/xsl/xsltprocessor.c:1.29 php-src/ext/xsl/xsltprocessor.c:1.30 --- php-src/ext/xsl/xsltprocessor.c:1.29Fri May 28 10:17:46 2004 +++ php-src/ext/xsl/xsltprocessor.c Wed Jul 28 08:40:53 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: xsltprocessor.c,v 1.29 2004/05/28 14:17:46 iliaa Exp $ */ +/* $Id: xsltprocessor.c,v 1.30 2004/07/28 12:40:53 chregu Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -144,6 +144,7 @@ xmlXPathObjectPtr obj; char *str; char *callable = NULL; + xsl_object *intern; TSRMLS_FETCH(); @@ -258,6 +259,13 @@ if (retval-type == IS_OBJECT instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) { xmlNode *nodep; dom_object *obj; + intern = (xsl_object *) tctxt-_private; + if (intern-node_list == NULL) { + ALLOC_HASHTABLE(intern-node_list); + zend_hash_init(intern-node_list, 0, NULL, ZVAL_PTR_DTOR, 0); + } + zval_add_ref(retval); + zend_hash_next_index_insert(intern-node_list, retval, sizeof(zval *), NULL); obj = (dom_object *)zend_object_store_get_object(retval TSRMLS_CC); nodep = dom_object_get_node(obj); valuePush(ctxt, xmlXPathNewNodeSet(nodep)); @@ -378,6 +386,55 @@ /* }}} end xsl_xsltprocessor_import_stylesheet */ +static xmlDocPtr php_xsl_apply_stylesheet(xsl_object *intern, xsltStylesheetPtr style, xmlDocPtr doc TSRMLS_DC) +{ + xmlDocPtr newdocp; +
[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/xsl php_xsl.c php_xsl.h xsltprocessor.c
chregu Wed Jul 28 08:42:16 2004 EDT Modified files: (Branch: PHP_5_0) /php-srcNEWS /php-src/ext/xslphp_xsl.c php_xsl.h xsltprocessor.c Log: MFH Fixed bug #29409 (Segfault in PHP functions called from XSLT). (Rob) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.12r2=1.1760.2.13ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.12 php-src/NEWS:1.1760.2.13 --- php-src/NEWS:1.1760.2.12Tue Jul 27 21:44:41 2004 +++ php-src/NEWSWed Jul 28 08:42:16 2004 @@ -1,6 +1,7 @@ PHPNEWS ||| ?? ??? 2004, PHP 5.0.1 +- Fixed bug #29409 (Segfault in PHP functions called from XSLT). (Rob) - Fixed unloading of dynamically loaded extensions. (Marcus, kameshj at fastmail dot fm) - Fixed bug 29395 (sqlite_escape_string() returns bogus data on empty http://cvs.php.net/diff.php/php-src/ext/xsl/php_xsl.c?r1=1.22r2=1.22.2.1ty=u Index: php-src/ext/xsl/php_xsl.c diff -u php-src/ext/xsl/php_xsl.c:1.22 php-src/ext/xsl/php_xsl.c:1.22.2.1 --- php-src/ext/xsl/php_xsl.c:1.22 Mon Jul 12 09:04:01 2004 +++ php-src/ext/xsl/php_xsl.c Wed Jul 28 08:42:16 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xsl.c,v 1.22 2004/07/12 13:04:01 chregu Exp $ */ +/* $Id: php_xsl.c,v 1.22.2.1 2004/07/28 12:42:16 chregu Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -132,6 +132,11 @@ zend_hash_destroy(intern-parameter); FREE_HASHTABLE(intern-parameter); + if (intern-node_list) { + zend_hash_destroy(intern-node_list); + FREE_HASHTABLE(intern-node_list); + } + if (intern-ptr) { /* free wrapper */ if (((xsltStylesheetPtr) intern-ptr)-_private != NULL) { @@ -160,6 +165,7 @@ intern-parameter = NULL; intern-hasKeys = 0; intern-registerPhpFunctions = 0; + intern-node_list = NULL; ALLOC_HASHTABLE(intern-std.properties); zend_hash_init(intern-std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); @@ -285,6 +291,7 @@ */ PHP_RINIT_FUNCTION(xsl) { + xsltSetGenericErrorFunc(NULL, php_libxml_error_handler); return SUCCESS; } /* }}} */ @@ -294,6 +301,7 @@ */ PHP_RSHUTDOWN_FUNCTION(xsl) { + xsltSetGenericErrorFunc(NULL, NULL); return SUCCESS; } /* }}} */ http://cvs.php.net/diff.php/php-src/ext/xsl/php_xsl.h?r1=1.10r2=1.10.2.1ty=u Index: php-src/ext/xsl/php_xsl.h diff -u php-src/ext/xsl/php_xsl.h:1.10 php-src/ext/xsl/php_xsl.h:1.10.2.1 --- php-src/ext/xsl/php_xsl.h:1.10 Wed Feb 4 06:14:47 2004 +++ php-src/ext/xsl/php_xsl.h Wed Jul 28 08:42:16 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xsl.h,v 1.10 2004/02/04 11:14:47 zeev Exp $ */ +/* $Id: php_xsl.h,v 1.10.2.1 2004/07/28 12:42:16 chregu Exp $ */ #ifndef PHP_XSL_H #define PHP_XSL_H @@ -57,6 +57,7 @@ HashTable *parameter; int hasKeys; int registerPhpFunctions; + HashTable *node_list; } xsl_object; void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC); http://cvs.php.net/diff.php/php-src/ext/xsl/xsltprocessor.c?r1=1.29r2=1.29.2.1ty=u Index: php-src/ext/xsl/xsltprocessor.c diff -u php-src/ext/xsl/xsltprocessor.c:1.29 php-src/ext/xsl/xsltprocessor.c:1.29.2.1 --- php-src/ext/xsl/xsltprocessor.c:1.29Fri May 28 10:17:46 2004 +++ php-src/ext/xsl/xsltprocessor.c Wed Jul 28 08:42:16 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: xsltprocessor.c,v 1.29 2004/05/28 14:17:46 iliaa Exp $ */ +/* $Id: xsltprocessor.c,v 1.29.2.1 2004/07/28 12:42:16 chregu Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -144,6 +144,7 @@ xmlXPathObjectPtr obj; char *str; char *callable = NULL; + xsl_object *intern; TSRMLS_FETCH(); @@ -258,6 +259,13 @@ if (retval-type == IS_OBJECT instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) { xmlNode *nodep; dom_object *obj; + intern = (xsl_object *) tctxt-_private; + if (intern-node_list == NULL) { + ALLOC_HASHTABLE(intern-node_list); + zend_hash_init(intern-node_list, 0, NULL, ZVAL_PTR_DTOR, 0); + } + zval_add_ref(retval); + zend_hash_next_index_insert(intern-node_list, retval, sizeof(zval *), NULL); obj = (dom_object *)zend_object_store_get_object(retval TSRMLS_CC); nodep =
Re: [PHP-CVS] cvs: php-src / NEWS /ext/xsl php_xsl.c php_xsl.h xsltprocessor.c
Hey chregu, when it's fixed in 5_0 and announced that it is fixed there you should not announce it in NEWS residing in HEAD. thanks, andrey Christian Stocker wrote: chregu Wed Jul 28 08:40:53 2004 EDT Modified files: /php-src NEWS /php-src/ext/xsl php_xsl.c php_xsl.h xsltprocessor.c Log: Fix for bug #29409 (Segfault in PHP functions called from XSLT). (by Rob) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1777r2=1.1778ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1777 php-src/NEWS:1.1778 --- php-src/NEWS:1.1777 Mon Jul 26 03:18:58 2004 +++ php-src/NEWS Wed Jul 28 08:40:53 2004 @@ -1,6 +1,7 @@ PHPNEWS ||| ?? ??? 2004, PHP 5.1.0 +- Fixed bug #29409 (Segfault in PHP functions called from XSLT). (Rob) - Fixed bug #29335 (fetch functions now use MYSQLI_BOTH as default) (Georg) - Fixed bug #29311 (calling parent constructor in mysqli). (Georg) - Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry) http://cvs.php.net/diff.php/php-src/ext/xsl/php_xsl.c?r1=1.23r2=1.24ty=u Index: php-src/ext/xsl/php_xsl.c diff -u php-src/ext/xsl/php_xsl.c:1.23 php-src/ext/xsl/php_xsl.c:1.24 --- php-src/ext/xsl/php_xsl.c:1.23 Sun Jul 25 04:37:39 2004 +++ php-src/ext/xsl/php_xsl.c Wed Jul 28 08:40:53 2004 @@ -16,7 +16,7 @@ +--+ */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl/examples autoload.inc dbareader.inc
helly Wed Jul 28 18:52:11 2004 EDT Modified files: /php-src/ext/spl/examples autoload.inc dbareader.inc Log: - Update examples http://cvs.php.net/diff.php/php-src/ext/spl/examples/autoload.inc?r1=1.5r2=1.6ty=u Index: php-src/ext/spl/examples/autoload.inc diff -u php-src/ext/spl/examples/autoload.inc:1.5 php-src/ext/spl/examples/autoload.inc:1.6 --- php-src/ext/spl/examples/autoload.inc:1.5 Mon May 10 13:26:03 2004 +++ php-src/ext/spl/examples/autoload.inc Wed Jul 28 18:52:11 2004 @@ -33,7 +33,10 @@ */ function __autoload($classname) { $classname = strtolower($classname); - foreach(split(':', ini_get('include_path')) as $dir) + $inc = split(':', ini_get('include_path')); + $inc[] = '.'; + $inc[] = dirname($_SERVER['PATH_TRANSLATED']); + foreach($inc as $dir) { if (__load_class($classname, $dir)) { @@ -41,10 +44,7 @@ return; } } - if (!__load_class($classname, '.')) - if (!__load_class($classname, dirname($_SERVER['PATH_TRANSLATED']))) fprintf(STDERR, 'Class not found ('.$classname.)\n); - return; } ? http://cvs.php.net/diff.php/php-src/ext/spl/examples/dbareader.inc?r1=1.2r2=1.3ty=u Index: php-src/ext/spl/examples/dbareader.inc diff -u php-src/ext/spl/examples/dbareader.inc:1.2 php-src/ext/spl/examples/dbareader.inc:1.3 --- php-src/ext/spl/examples/dbareader.inc:1.2 Mon May 10 13:26:03 2004 +++ php-src/ext/spl/examples/dbareader.inc Wed Jul 28 18:52:11 2004 @@ -28,32 +28,24 @@ * @param handler Handler to use for database access. */ function __construct($file, $handler) { - $this-db = dba_open($file, 'r', $handler); + if (!$this-db = dba_open($file, 'r', $handler)) { + throw new exception('Could not open file ' . $file); + } } /** * Close database. */ function __destruct() { - if ($this-db) { - dba_close($this-db); - } + dba_close($this-db); } /** * Rewind to first element. */ function rewind() { - if ($this-db) { - $this-key = dba_firstkey($this-db); - } - } - - /** -* @return Current data. -*/ - function current() { - return $this-val; + $this-key = dba_firstkey($this-db); + fetch_data(); } /** @@ -62,12 +54,24 @@ * @return void */ function next() { - if ($this-db) { - $this-key = dba_nextkey($this-db); - if ($this-key !== false) { - $this-val = dba_fetch($this-key, $this-db); - } + $this-key = dba_nextkey($this-db); + fetch_data(); + } + +/** + * Fetches the current data if $key is valid + */ + private function fetch_data() { + if ($this-key !== false) { + $this-val = dba_fetch($this-key, $this-db); } + } + + /** +* @return Current data. +*/ + function current() { + return $this-val; } /** -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_iterators.c
helly Wed Jul 28 18:53:11 2004 EDT Modified files: /php-src/ext/splspl_iterators.c Log: - Fix problem when inner constructor isn't called from derived constructor (foound by david) http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.38r2=1.39ty=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.38 php-src/ext/spl/spl_iterators.c:1.39 --- php-src/ext/spl/spl_iterators.c:1.38Mon May 31 04:58:32 2004 +++ php-src/ext/spl/spl_iterators.c Wed Jul 28 18:53:10 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.38 2004/05/31 08:58:32 zeev Exp $ */ +/* $Id: spl_iterators.c,v 1.39 2004/07/28 22:53:10 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -634,8 +634,16 @@ } } /* }}} */ +static INLINE void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC) +{ + if (!intern-inner.iterator) { + php_error_docref(NULL TSRMLS_CC, E_ERROR, The inner constructor wasn't initialized with an iterator instance); + } +} + static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC) { + spl_dual_it_require(intern TSRMLS_CC); if (intern-inner.iterator intern-inner.iterator-funcs-invalidate_current) { intern-inner.iterator-funcs-invalidate_current(intern-inner.iterator TSRMLS_CC); } @@ -698,6 +706,8 @@ { if (do_free) { spl_dual_it_free(intern TSRMLS_CC); + } else { + spl_dual_it_require(intern TSRMLS_CC); } intern-inner.iterator-funcs-move_forward(intern-inner.iterator TSRMLS_CC); intern-current.pos++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/spl spl_iterators.c /ext/spl/examples autoload.inc dbareader.inc
helly Wed Jul 28 18:55:26 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/splspl_iterators.c /php-src/ext/spl/examples autoload.inc dbareader.inc Log: MFH http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.38r2=1.38.2.1ty=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.38 php-src/ext/spl/spl_iterators.c:1.38.2.1 --- php-src/ext/spl/spl_iterators.c:1.38Mon May 31 04:58:32 2004 +++ php-src/ext/spl/spl_iterators.c Wed Jul 28 18:55:26 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.38 2004/05/31 08:58:32 zeev Exp $ */ +/* $Id: spl_iterators.c,v 1.38.2.1 2004/07/28 22:55:26 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -634,8 +634,16 @@ } } /* }}} */ +static INLINE void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC) +{ + if (!intern-inner.iterator) { + php_error_docref(NULL TSRMLS_CC, E_ERROR, The inner constructor wasn't initialized with an iterator instance); + } +} + static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC) { + spl_dual_it_require(intern TSRMLS_CC); if (intern-inner.iterator intern-inner.iterator-funcs-invalidate_current) { intern-inner.iterator-funcs-invalidate_current(intern-inner.iterator TSRMLS_CC); } @@ -698,6 +706,8 @@ { if (do_free) { spl_dual_it_free(intern TSRMLS_CC); + } else { + spl_dual_it_require(intern TSRMLS_CC); } intern-inner.iterator-funcs-move_forward(intern-inner.iterator TSRMLS_CC); intern-current.pos++; http://cvs.php.net/diff.php/php-src/ext/spl/examples/autoload.inc?r1=1.5r2=1.5.2.1ty=u Index: php-src/ext/spl/examples/autoload.inc diff -u php-src/ext/spl/examples/autoload.inc:1.5 php-src/ext/spl/examples/autoload.inc:1.5.2.1 --- php-src/ext/spl/examples/autoload.inc:1.5 Mon May 10 13:26:03 2004 +++ php-src/ext/spl/examples/autoload.inc Wed Jul 28 18:55:26 2004 @@ -33,7 +33,10 @@ */ function __autoload($classname) { $classname = strtolower($classname); - foreach(split(':', ini_get('include_path')) as $dir) + $inc = split(':', ini_get('include_path')); + $inc[] = '.'; + $inc[] = dirname($_SERVER['PATH_TRANSLATED']); + foreach($inc as $dir) { if (__load_class($classname, $dir)) { @@ -41,10 +44,7 @@ return; } } - if (!__load_class($classname, '.')) - if (!__load_class($classname, dirname($_SERVER['PATH_TRANSLATED']))) fprintf(STDERR, 'Class not found ('.$classname.)\n); - return; } ? http://cvs.php.net/diff.php/php-src/ext/spl/examples/dbareader.inc?r1=1.2r2=1.2.2.1ty=u Index: php-src/ext/spl/examples/dbareader.inc diff -u php-src/ext/spl/examples/dbareader.inc:1.2 php-src/ext/spl/examples/dbareader.inc:1.2.2.1 --- php-src/ext/spl/examples/dbareader.inc:1.2 Mon May 10 13:26:03 2004 +++ php-src/ext/spl/examples/dbareader.inc Wed Jul 28 18:55:26 2004 @@ -28,32 +28,24 @@ * @param handler Handler to use for database access. */ function __construct($file, $handler) { - $this-db = dba_open($file, 'r', $handler); + if (!$this-db = dba_open($file, 'r', $handler)) { + throw new exception('Could not open file ' . $file); + } } /** * Close database. */ function __destruct() { - if ($this-db) { - dba_close($this-db); - } + dba_close($this-db); } /** * Rewind to first element. */ function rewind() { - if ($this-db) { - $this-key = dba_firstkey($this-db); - } - } - - /** -* @return Current data. -*/ - function current() { - return $this-val; + $this-key = dba_firstkey($this-db); + fetch_data(); } /** @@ -62,12 +54,24 @@ * @return void */ function next() { - if ($this-db) { - $this-key = dba_nextkey($this-db); - if ($this-key !== false) { - $this-val = dba_fetch($this-key, $this-db); - } + $this-key = dba_nextkey($this-db); + fetch_data(); + } + +/** + * Fetches the current data if $key is valid + */ + private function fetch_data() { + if ($this-key !== false) { + $this-val = dba_fetch($this-key, $this-db); } + } + + /** +* @return Current data. +*/ + function
[PHP-CVS] cvs: php-src /main network.c
wez Wed Jul 28 19:15:25 2004 EDT Modified files: /php-src/main network.c Log: Fix #29431: crash when parsing an invalid network address http://cvs.php.net/diff.php/php-src/main/network.c?r1=1.109r2=1.110ty=u Index: php-src/main/network.c diff -u php-src/main/network.c:1.109 php-src/main/network.c:1.110 --- php-src/main/network.c:1.109Fri Apr 9 15:18:59 2004 +++ php-src/main/network.c Wed Jul 28 19:15:25 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: network.c,v 1.109 2004/04/09 19:18:59 pollita Exp $ */ +/* $Id: network.c,v 1.110 2004/07/28 23:15:25 wez Exp $ */ /*#define DEBUG_MAIN_NETWORK 1*/ @@ -495,12 +495,15 @@ if (*addr == '[') { colon = memchr(addr + 1, ']', addrlen-1); if (!colon || colon[1] != ':') { - return 0; + return FAILURE; } port = atoi(colon + 2); addr++; } else { colon = memchr(addr, ':', addrlen); + if (!colon || colon[1] != ':') { + return FAILURE; + } port = atoi(colon + 1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard streamsfuncs.c
iliaa Wed Jul 28 19:21:54 2004 EDT Modified files: /php-src/ext/standard streamsfuncs.c Log: Fixed possible crash in stream_socket_recvfrom() when length parameter has a negative value. http://cvs.php.net/diff.php/php-src/ext/standard/streamsfuncs.c?r1=1.36r2=1.37ty=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.36 php-src/ext/standard/streamsfuncs.c:1.37 --- php-src/ext/standard/streamsfuncs.c:1.36Thu Jul 22 08:12:28 2004 +++ php-src/ext/standard/streamsfuncs.c Wed Jul 28 19:21:54 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: streamsfuncs.c,v 1.36 2004/07/22 12:12:28 wez Exp $ */ +/* $Id: streamsfuncs.c,v 1.37 2004/07/28 23:21:54 iliaa Exp $ */ #include php.h #include php_globals.h @@ -316,6 +316,11 @@ zval_dtor(zremote); ZVAL_NULL(zremote); Z_STRLEN_P(zremote) = 0; + } + + if (to_read = 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Length parameter must be greater than 0.); + RETURN_FALSE; } read_buf = emalloc(to_read + 1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/standard streamsfuncs.c
iliaa Wed Jul 28 19:21:56 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard streamsfuncs.c Log: MFH: Fixed possible crash in stream_socket_recvfrom() when length parameter has a negative value. http://cvs.php.net/diff.php/php-src/ext/standard/streamsfuncs.c?r1=1.35r2=1.35.2.1ty=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.35 php-src/ext/standard/streamsfuncs.c:1.35.2.1 --- php-src/ext/standard/streamsfuncs.c:1.35Wed Jun 16 19:57:25 2004 +++ php-src/ext/standard/streamsfuncs.c Wed Jul 28 19:21:56 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: streamsfuncs.c,v 1.35 2004/06/16 23:57:25 abies Exp $ */ +/* $Id: streamsfuncs.c,v 1.35.2.1 2004/07/28 23:21:56 iliaa Exp $ */ #include php.h #include php_globals.h @@ -316,6 +316,11 @@ zval_dtor(zremote); ZVAL_NULL(zremote); Z_STRLEN_P(zremote) = 0; + } + + if (to_read = 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Length parameter must be greater than 0.); + RETURN_FALSE; } read_buf = emalloc(to_read + 1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main network.c
wez Wed Jul 28 19:30:23 2004 EDT Modified files: /php-src/main network.c Log: Ensure that port numbers get set in the peer/socket name functions. (duh!) http://cvs.php.net/diff.php/php-src/main/network.c?r1=1.110r2=1.111ty=u Index: php-src/main/network.c diff -u php-src/main/network.c:1.110 php-src/main/network.c:1.111 --- php-src/main/network.c:1.110Wed Jul 28 19:15:25 2004 +++ php-src/main/network.c Wed Jul 28 19:30:23 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: network.c,v 1.110 2004/07/28 23:15:25 wez Exp $ */ +/* $Id: network.c,v 1.111 2004/07/28 23:30:23 wez Exp $ */ /*#define DEBUG_MAIN_NETWORK 1*/ @@ -501,7 +501,7 @@ addr++; } else { colon = memchr(addr, ':', addrlen); - if (!colon || colon[1] != ':') { + if (!colon) { return FAILURE; } port = atoi(colon + 1); @@ -592,8 +592,8 @@ /* generally not thread safe, but it *is* thread safe under win32 */ buf = inet_ntoa(((struct sockaddr_in*)sa)-sin_addr); if (buf) { - *textaddrlen = strlen(buf); - *textaddr = estrndup(buf, *textaddrlen); + *textaddrlen = spprintf(textaddr, 0, %s:%d, + buf, ntohs(((struct sockaddr_in*)sa)-sin_port)); } break; @@ -602,8 +602,8 @@ case AF_INET6: buf = (char*)inet_ntop(sa-sa_family, ((struct sockaddr_in6*)sa)-sin6_addr, (char *)abuf, sizeof(abuf)); if (buf) { - *textaddrlen = strlen(buf); - *textaddr = estrndup(buf, *textaddrlen); + *textaddrlen = spprintf(textaddr, 0, %s:%d, + buf, ntohs(((struct sockaddr_in6*)sa)-sin6_port)); } break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard streamsfuncs.c
iliaa Wed Jul 28 19:34:27 2004 EDT Modified files: /php-src/ext/standard streamsfuncs.c Log: Better address availability check. http://cvs.php.net/diff.php/php-src/ext/standard/streamsfuncs.c?r1=1.37r2=1.38ty=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.37 php-src/ext/standard/streamsfuncs.c:1.38 --- php-src/ext/standard/streamsfuncs.c:1.37Wed Jul 28 19:21:54 2004 +++ php-src/ext/standard/streamsfuncs.c Wed Jul 28 19:34:27 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: streamsfuncs.c,v 1.37 2004/07/28 23:21:54 iliaa Exp $ */ +/* $Id: streamsfuncs.c,v 1.38 2004/07/28 23:34:27 iliaa Exp $ */ #include php.h #include php_globals.h @@ -273,7 +273,7 @@ php_stream *stream; zval *zstream; long flags = 0; - char *data, *target_addr = NULL; + char *data, *target_addr; int datalen, target_addr_len = 0; php_sockaddr_storage sa; socklen_t sl = 0; @@ -283,7 +283,7 @@ } php_stream_from_zval(stream, zstream); - if (target_addr) { + if (target_addr_len) { /* parse the address */ if (FAILURE == php_network_parse_network_address_with_port(target_addr, target_addr_len, (struct sockaddr*)sa, sl TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to parse `%s' into a valid network address, target_addr); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/standard streamsfuncs.c
iliaa Wed Jul 28 19:34:30 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard streamsfuncs.c Log: MFH: Better address availability check. http://cvs.php.net/diff.php/php-src/ext/standard/streamsfuncs.c?r1=1.35.2.1r2=1.35.2.2ty=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.35.2.1 php-src/ext/standard/streamsfuncs.c:1.35.2.2 --- php-src/ext/standard/streamsfuncs.c:1.35.2.1Wed Jul 28 19:21:56 2004 +++ php-src/ext/standard/streamsfuncs.c Wed Jul 28 19:34:30 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: streamsfuncs.c,v 1.35.2.1 2004/07/28 23:21:56 iliaa Exp $ */ +/* $Id: streamsfuncs.c,v 1.35.2.2 2004/07/28 23:34:30 iliaa Exp $ */ #include php.h #include php_globals.h @@ -273,7 +273,7 @@ php_stream *stream; zval *zstream; long flags = 0; - char *data, *target_addr = NULL; + char *data, *target_addr; int datalen, target_addr_len = 0; php_sockaddr_storage sa; socklen_t sl = 0; @@ -283,7 +283,7 @@ } php_stream_from_zval(stream, zstream); - if (target_addr) { + if (target_addr_len) { /* parse the address */ if (FAILURE == php_network_parse_network_address_with_port(target_addr, target_addr_len, (struct sockaddr*)sa, sl TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to parse `%s' into a valid network address, target_addr); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /sapi/activescript CREDITS EXPERIMENTAL README classfactory.cpp config.w32 php5activescript.c php5activescript.def php5activescript.dsp php5activescript.h php5as_classfactory.h php5as_scriptengine.h scriptengine.cpp
wez Wed Jul 28 19:39:36 2004 EDT Removed files: (Branch: PHP_5_0) /php-src/sapi/activescript CREDITS EXPERIMENTAL README classfactory.cpp config.w32 php5activescript.c php5activescript.def php5activescript.dsp php5activescript.h php5as_classfactory.h php5as_scriptengine.h scriptengine.cpp Log: Moved to PECL -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/com_dotnet com_extension.c com_handlers.c com_variant.c com_wrapper.c
wez Wed Jul 28 19:48:26 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/com_dotnet com_extension.c com_handlers.c com_variant.c com_wrapper.c Log: MFH: #29258: variant_date_from_timestamp() does not honour timezone #29392: com_dotnet crashes when echo'ing an object http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_extension.c?r1=1.14r2=1.14.2.1ty=u Index: php-src/ext/com_dotnet/com_extension.c diff -u php-src/ext/com_dotnet/com_extension.c:1.14 php-src/ext/com_dotnet/com_extension.c:1.14.2.1 --- php-src/ext/com_dotnet/com_extension.c:1.14 Sun May 9 11:21:29 2004 +++ php-src/ext/com_dotnet/com_extension.c Wed Jul 28 19:48:26 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: com_extension.c,v 1.14 2004/05/09 15:21:29 wez Exp $ */ +/* $Id: com_extension.c,v 1.14.2.1 2004/07/28 23:48:26 wez Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -194,7 +194,7 @@ INIT_CLASS_ENTRY(ce, com_exception, NULL); php_com_exception_class_entry = zend_register_internal_class_ex(ce, zend_exception_get_default(), NULL TSRMLS_CC); php_com_exception_class_entry-ce_flags |= ZEND_ACC_FINAL; - php_com_exception_class_entry-constructor-common.fn_flags |= ZEND_ACC_PROTECTED; +// php_com_exception_class_entry-constructor-common.fn_flags |= ZEND_ACC_PROTECTED; INIT_CLASS_ENTRY(ce, com_safearray_proxy, NULL); php_com_saproxy_class_entry = zend_register_internal_class(ce TSRMLS_CC); http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_handlers.c?r1=1.22r2=1.22.2.1ty=u Index: php-src/ext/com_dotnet/com_handlers.c diff -u php-src/ext/com_dotnet/com_handlers.c:1.22 php-src/ext/com_dotnet/com_handlers.c:1.22.2.1 --- php-src/ext/com_dotnet/com_handlers.c:1.22 Tue May 4 11:03:48 2004 +++ php-src/ext/com_dotnet/com_handlers.c Wed Jul 28 19:48:26 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: com_handlers.c,v 1.22 2004/05/04 15:03:48 wez Exp $ */ +/* $Id: com_handlers.c,v 1.22.2.1 2004/07/28 23:48:26 wez Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -286,11 +286,19 @@ } } +static PHP_FUNCTION(com_method_handler) +{ + Z_OBJ_HANDLER_P(getThis(), call_method)( + ((zend_internal_function*)EG(function_state_ptr)-function)-function_name, + INTERNAL_FUNCTION_PARAM_PASSTHRU); +} + static union _zend_function *com_method_get(zval *object, char *name, int len TSRMLS_DC) { zend_internal_function f, *fptr = NULL; php_com_dotnet_object *obj; union _zend_function *func; + DISPID dummy; obj = CDNO_FETCH(object); @@ -298,6 +306,10 @@ return NULL; } + if (FAILED(php_com_get_id_of_name(obj, name, len, dummy TSRMLS_CC))) { + return NULL; + } + /* check cache */ if (obj-method_cache == NULL || FAILURE == zend_hash_find(obj-method_cache, name, len, (void**)fptr)) { f.type = ZEND_OVERLOADED_FUNCTION; @@ -306,7 +318,10 @@ f.scope = obj-ce; f.fn_flags = 0; f.function_name = estrndup(name, len); + f.handler = PHP_FN(com_method_handler); + fptr = f; + if (obj-typeinfo) { /* look for byref params */ ITypeComp *comp; @@ -346,6 +361,9 @@ case DESCKIND_TYPECOMP: ITypeComp_Release(bindptr.lptcomp); break; + + case DESCKIND_NONE: + break; } if (TI) { ITypeInfo_Release(TI); @@ -356,21 +374,27 @@ } } - /* save this method in the cache */ - if (!obj-method_cache) { - ALLOC_HASHTABLE(obj-method_cache); - zend_hash_init(obj-method_cache, 2, NULL, function_dtor, 0); - } + if (fptr) { + /* save this method in the cache */ + if (!obj-method_cache) { + ALLOC_HASHTABLE(obj-method_cache); + zend_hash_init(obj-method_cache, 2, NULL, function_dtor, 0); + } - zend_hash_update(obj-method_cache, name, len, f, sizeof(f), (void**)fptr); + zend_hash_update(obj-method_cache, name, len, f, sizeof(f), (void**)fptr); + } } - /*
[PHP-CVS] cvs: php-src /ext/standard array.c
iliaa Wed Jul 28 20:35:09 2004 EDT Modified files: /php-src/ext/standard array.c Log: Fixed but #29437 (Possible crash inside array_walk_recursive()). http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.269r2=1.270ty=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.269 php-src/ext/standard/array.c:1.270 --- php-src/ext/standard/array.c:1.269 Mon Jul 26 02:32:54 2004 +++ php-src/ext/standard/array.cWed Jul 28 20:35:07 2004 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.269 2004/07/26 06:32:54 andrey Exp $ */ +/* $Id: array.c,v 1.270 2004/07/29 00:35:07 iliaa Exp $ */ #include php.h #include php_ini.h @@ -996,7 +996,7 @@ { zval **args[3], /* Arguments to userland function */ *retval_ptr, /* Return value - unused */ - *key; /* Entry key */ + *key=NULL;/* Entry key */ char *string_key; uint string_key_len; ulong num_key; @@ -1060,7 +1060,10 @@ } } - zval_ptr_dtor(key); + if (key) { + zval_ptr_dtor(key); + key = NULL; + } zend_hash_move_forward_ex(target_hash, pos); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard basic_functions.c syslog.c /win32 globals.c php_win32_globals.h pwd.c time.c wsyslog.c /win32/build config.w32
wez Wed Jul 28 22:59:44 2004 EDT Added files: /php-src/win32 globals.c php_win32_globals.h Modified files: /php-src/ext/standard basic_functions.c syslog.c /php-src/win32 pwd.c time.c wsyslog.c /php-src/win32/buildconfig.w32 Log: Misc. win32 thread safety fixes. http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.676r2=1.677ty=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.676 php-src/ext/standard/basic_functions.c:1.677 --- php-src/ext/standard/basic_functions.c:1.676Thu Jul 22 08:12:28 2004 +++ php-src/ext/standard/basic_functions.c Wed Jul 28 22:59:43 2004 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.676 2004/07/22 12:12:28 wez Exp $ */ +/* $Id: basic_functions.c,v 1.677 2004/07/29 02:59:43 wez Exp $ */ #include php.h #include php_streams.h @@ -35,6 +35,10 @@ #include ext/standard/dns.h #include ext/standard/php_uuencode.h +#ifdef PHP_WIN32 +#include win32/php_win32_globals.h +#endif + typedef struct yy_buffer_state *YY_BUFFER_STATE; #include zend.h @@ -1005,8 +1009,14 @@ { #ifdef ZTS ts_allocate_id(basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor); +#ifdef PHP_WIN32 + ts_allocate_id(php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, NULL); +#endif #else basic_globals_ctor(basic_globals TSRMLS_CC); +#ifdef PHP_WIN32 + php_win32_core_globals_ctor(php_win32_core_globals TSRMLS_CC); +#endif #endif REGISTER_LONG_CONSTANT(CONNECTION_ABORTED, PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT); @@ -1105,6 +1115,9 @@ { #ifdef ZTS ts_free_id(basic_globals_id); +#ifdef PHP_WIN32 + ts_free_id(php_win32_core_globals_id); +#endif #else basic_globals_dtor(basic_globals TSRMLS_CC); #endif @@ -1214,6 +1227,7 @@ PHP_RSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_RSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_RSHUTDOWN(streams)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + PHP_RSHUTDOWN(win32_core_globals)(SHUTDOWN_FUNC_ARGS_PASSTHRU); if (BG(user_tick_functions)) { zend_llist_destroy(BG(user_tick_functions)); http://cvs.php.net/diff.php/php-src/ext/standard/syslog.c?r1=1.46r2=1.47ty=u Index: php-src/ext/standard/syslog.c diff -u php-src/ext/standard/syslog.c:1.46 php-src/ext/standard/syslog.c:1.47 --- php-src/ext/standard/syslog.c:1.46 Sun Jun 13 13:04:36 2004 +++ php-src/ext/standard/syslog.c Wed Jul 28 22:59:43 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: syslog.c,v 1.46 2004/06/13 17:04:36 iliaa Exp $ */ +/* $Id: syslog.c,v 1.47 2004/07/29 02:59:43 wez Exp $ */ #include php.h @@ -119,6 +119,9 @@ if (BG(syslog_device)) { efree(BG(syslog_device)); } +#ifdef PHP_WIN32 + closelog(); +#endif return SUCCESS; } http://cvs.php.net/diff.php/php-src/win32/pwd.c?r1=1.9r2=1.10ty=u Index: php-src/win32/pwd.c diff -u php-src/win32/pwd.c:1.9 php-src/win32/pwd.c:1.10 --- php-src/win32/pwd.c:1.9 Thu Jan 8 03:18:21 2004 +++ php-src/win32/pwd.c Wed Jul 28 22:59:43 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: pwd.c,v 1.9 2004/01/08 08:18:21 andi Exp $ */ +/* $Id: pwd.c,v 1.10 2004/07/29 02:59:43 wez Exp $ */ #include php.h /*php specific */ #include lmaccess.h @@ -26,10 +26,7 @@ #include lmapibuf.h #include pwd.h #include grp.h - -#ifndef THREAD_SAFE -static struct passwd pwd; -#endif +#include php_win32_globals.h static char *home_dir = .; static char *login_shell = not command.com!; @@ -44,21 +41,26 @@ char * getlogin() { - static char name[256]; + char name[256]; DWORD max_len = 256; + TSRMLS_FETCH(); + STR_FREE(PW32G(login_name)); GetUserName(name, max_len); - return name; + name[max_len] = '\0'; + PW32G(login_name) = strdup(name); + return PW32G(login_name); } struct passwd * getpwuid(int user_id) { - pwd.pw_name = getlogin(); - pwd.pw_dir = home_dir; - pwd.pw_shell = login_shell; - pwd.pw_uid = 0; + TSRMLS_FETCH(); + PW32G(pwd).pw_name = getlogin(); + PW32G(pwd).pw_dir = home_dir; + PW32G(pwd).pw_shell = login_shell; + PW32G(pwd).pw_uid = 0; - return pwd; + return PW32G(pwd); } http://cvs.php.net/diff.php/php-src/win32/time.c?r1=1.9r2=1.10ty=u Index: php-src/win32/time.c diff -u php-src/win32/time.c:1.9 php-src/win32/time.c:1.10 --- php-src/win32/time.c:1.9Mon Jan 12 21:07:04 2004 +++