[PHP-CVS] cvs: php-src /ext/oci8 oci8.dsp
phanto Tue Dec 16 05:27:48 2003 EDT Modified files: /php-src/ext/oci8 oci8.dsp Log: fix include path Index: php-src/ext/oci8/oci8.dsp diff -u php-src/ext/oci8/oci8.dsp:1.11 php-src/ext/oci8/oci8.dsp:1.12 --- php-src/ext/oci8/oci8.dsp:1.11 Tue Aug 20 05:15:11 2002 +++ php-src/ext/oci8/oci8.dsp Tue Dec 16 05:27:48 2003 @@ -43,8 +43,8 @@ # PROP Intermediate_Dir Release_TS # PROP Ignore_Export_Lib 0 # PROP Target_Dir -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I ..\.. /I ..\..\..\Zend /I ..\..\..\bindlib_w32 /I ..\..\..\TSRM /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ..\..\\ /I ..\..\main /I ..\..\Zend /I ..\..\..\bindlib_w32 /I ..\..\TSRM /I ..\..\..\php_build\oci805\include /D ZEND_DEBUG=0 /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL /D ZTS=1 /D ZEND_WIN32 /D PHP_WIN32 /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /YX /FD /c +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I ..\.. /I ..\..\..\ZendEngine2 /I ..\..\..\bindlib_w32 /I ..\..\..\TSRM /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL /D ZTS=1 /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I ..\..\\ /I ..\..\main /I ..\..\ZendEngine2 /I ..\..\..\bindlib_w32 /I ..\..\TSRM /I ..\..\..\php_build\oci805\include /D ZEND_DEBUG=0 /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL /D ZTS=1 /D ZEND_WIN32 /D PHP_WIN32 /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /YX /FD /c # ADD BASE MTL /nologo /D NDEBUG /mktyplib203 /win32 # ADD MTL /nologo /D NDEBUG /mktyplib203 /win32 # ADD BASE RSC /l 0x406 /d NDEBUG @@ -70,8 +70,8 @@ # PROP Intermediate_Dir Debug_TS # PROP Ignore_Export_Lib 0 # PROP Target_Dir -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I ..\.. /I ..\..\Zend /I ..\..\..\bindlib_w32 /I ..\..\TSRM /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I ..\..\\ /I ..\..\main /I ..\..\Zend /I ..\..\..\bindlib_w32 /I ..\..\TSRM /I ..\..\..\php_build\include\oci805 /D ZEND_DEBUG=1 /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL /D FTP_EXPORTS /D ZTS=1 /D ZEND_WIN32 /D PHP_WIN32 /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /FR /YX /FD /c +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I ..\.. /I ..\..\ZendEngine2 /I ..\..\..\bindlib_w32 /I ..\..\TSRM /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL /D ZTS=1 /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I ..\..\\ /I ..\..\main /I ..\..\ZendEngine2 /I ..\..\..\bindlib_w32 /I ..\..\TSRM /I ..\..\..\php_build\include\oci805 /D ZEND_DEBUG=1 /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS /D _USRDLL /D FTP_EXPORTS /D ZTS=1 /D ZEND_WIN32 /D PHP_WIN32 /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /FR /YX /FD /c # ADD BASE MTL /nologo /D NDEBUG /mktyplib203 /win32 # ADD MTL /nologo /D NDEBUG /mktyplib203 /win32 # ADD BASE RSC /l 0x406 /d NDEBUG -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/oci8 CREDITS
phanto Tue Dec 16 05:28:01 2003 EDT Modified files: /php-src/ext/oci8 CREDITS Log: add myself Index: php-src/ext/oci8/CREDITS diff -u php-src/ext/oci8/CREDITS:1.4 php-src/ext/oci8/CREDITS:1.5 --- php-src/ext/oci8/CREDITS:1.4Wed Jan 29 13:31:48 2003 +++ php-src/ext/oci8/CREDITSTue Dec 16 05:28:00 2003 @@ -1,2 +1,2 @@ OCI8 -Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky +Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/oci8 oci8.c php_oci8.h
phanto Tue Dec 16 05:29:12 2003 EDT Modified files: /php-src/ext/oci8 oci8.c php_oci8.h Log: @- fixed #20006, #22674 and #24531 (harald) @- added ZTS connection pooling support to the oci extension @ connections will now be pooled per process and not @ per thread anymore. the number of persistent and active @ connections is now also shown in the phpinfo() output (harald) Index: php-src/ext/oci8/oci8.c diff -u php-src/ext/oci8/oci8.c:1.219 php-src/ext/oci8/oci8.c:1.220 --- php-src/ext/oci8/oci8.c:1.219 Mon Dec 15 08:53:01 2003 +++ php-src/ext/oci8/oci8.c Tue Dec 16 05:29:11 2003 @@ -18,15 +18,20 @@ | | | Collection support by Andy Sautins [EMAIL PROTECTED] | | Temporary LOB support by David Benson [EMAIL PROTECTED] | + | ZTS per process OCIPLogon by Harald Radi [EMAIL PROTECTED]| +--+ */ -/* $Id: oci8.c,v 1.219 2003/12/15 13:53:01 tony2001 Exp $ */ +/* $Id: oci8.c,v 1.220 2003/12/16 10:29:11 phanto Exp $ */ /* TODO list: * * - php.ini flags * especialliy important for things like oci_ping + * allowpconns + * timeout + * maxlifetime + * maxpconns * - Change return-value for OCIFetch*() (1-row read, 0-Normal end, false-error) * - Error mode (print or shut up?) * - binding of arrays @@ -37,7 +42,6 @@ * - make OCIInternalDebug accept a mask of flags * - have one ocifree() call. * - make it possible to have persistent statements? - * - implement connection pooling in ZTS mode. * - failover * - change all the lob stuff to work without classes (optional)! * - make sure that the callbacks terminate the strings with \0 @@ -60,6 +64,7 @@ #include php.h #include ext/standard/info.h +#include php_ini.h /* #define HAVE_OCI8_TEMP_LOB 1 */ #define WITH_COLLECTIONS 1 @@ -68,6 +73,13 @@ #include php_oci8.h +/* True globals, only used by thread safe functions */ +static TsHashTable *persistent_servers; +static TsHashTable *persistent_sessions; + +static long num_persistent = 0; +static long num_links = 0; + /* True globals, no need for thread safety */ static int le_conn; static int le_stmt; @@ -91,6 +103,21 @@ #define SAFE_STRING(s) ((s)?(s):) +#ifdef ZTS +MUTEX_T mx_lock; + +#define mutex_alloc() tsrm_mutex_alloc() +#define mutex_free(mutex) tsrm_mutex_free(mutex) +#define mutex_lock(mutex) tsrm_mutex_lock(mutex) +#define mutex_unlock(mutex) tsrm_mutex_unlock(mutex) +#define thread_id()tsrm_thread_id() +#else +#define mutex_alloc() +#define mutex_free(mutex) +#define mutex_lock(mutex) +#define mutex_unlock(mutex) +#define thread_id() 1 +#endif /* dirty marcos to make sure we _never_ call oracle-functions recursivly * @@ -462,35 +489,6 @@ }; /* }}} */ -/* {{{ debug malloc/realloc/free */ - -#define OCI_USE_EMALLOC 0 /* set this to 1 if you want to use the php memory manager! */ - -#if OCI_USE_EMALLOC -CONST dvoid *ocimalloc(dvoid *ctx, size_t size) -{ - dvoid *ret; - ret = (dvoid *)malloc(size); - oci_debug(ocimalloc(%d) = %08x, size,ret); - return ret; -} - -CONST dvoid *ocirealloc(dvoid *ctx, dvoid *ptr, size_t size) -{ - dvoid *ret; - oci_debug(ocirealloc(%08x, %d), ptr, size); - ret = (dvoid *)realloc(ptr, size); - return ptr; -} - -CONST void ocifree(dvoid *ctx, dvoid *ptr) -{ - oci_debug(ocifree(%08x), ptr); - free(ptr); -} -#endif - -/* }}} */ /* {{{ startup, shutdown and info functions */ static void php_oci_init_globals(php_oci_globals *oci_globals_p TSRMLS_DC) @@ -498,12 +496,6 @@ OCI(shutdown) = 0; OCI(in_call)= 0; - OCI(user) = malloc(sizeof(HashTable)); - zend_hash_init(OCI(user), 13, NULL, NULL, 1); - - OCI(server) = malloc(sizeof(HashTable)); - zend_hash_init(OCI(server), 13, NULL, NULL, 1); - CALL_OCI(OCIEnvInit( OCI(pEnv), OCI_DEFAULT, @@ -518,6 +510,27 @@ NULL)); } +static int _sessions_pcleanup(zend_llist *session_list TSRMLS_DC) +{ + zend_llist_destroy(session_list); + + return 1; +} + +static int _session_pcleanup(oci_session *session TSRMLS_DC) +{ + _oci_close_session(session); + + return 1; +} + +static int _server_pcleanup(oci_server *server TSRMLS_DC) +{ + _oci_close_server(server); + + return 1; +} + PHP_MINIT_FUNCTION(oci) { zend_class_entry oci_lob_class_entry; @@ -543,11 +556,14 @@ #endif -#if OCI_USE_EMALLOC - OCIInitialize(PHP_OCI_INIT_MODE, NULL, ocimalloc, ocirealloc, ocifree); -#else + mx_lock = mutex_alloc(); + + persistent_servers = malloc(sizeof(TsHashTable)); + persistent_sessions = malloc(sizeof(TsHashTable
[PHP-CVS] cvs: php-src /ext/oci8 oci8.c
phanto Tue Dec 16 06:15:56 2003 EDT Modified files: /php-src/ext/oci8 oci8.c Log: fix non-zts build errors Index: php-src/ext/oci8/oci8.c diff -u php-src/ext/oci8/oci8.c:1.220 php-src/ext/oci8/oci8.c:1.221 --- php-src/ext/oci8/oci8.c:1.220 Tue Dec 16 05:29:11 2003 +++ php-src/ext/oci8/oci8.c Tue Dec 16 06:15:55 2003 @@ -22,7 +22,7 @@ +--+ */ -/* $Id: oci8.c,v 1.220 2003/12/16 10:29:11 phanto Exp $ */ +/* $Id: oci8.c,v 1.221 2003/12/16 11:15:55 phanto Exp $ */ /* TODO list: * @@ -106,13 +106,13 @@ #ifdef ZTS MUTEX_T mx_lock; -#define mutex_alloc() tsrm_mutex_alloc() +#define mutex_alloc(mutex) mutex = tsrm_mutex_alloc() #define mutex_free(mutex) tsrm_mutex_free(mutex) #define mutex_lock(mutex) tsrm_mutex_lock(mutex) #define mutex_unlock(mutex) tsrm_mutex_unlock(mutex) #define thread_id()tsrm_thread_id() #else -#define mutex_alloc() +#define mutex_alloc(mutex) #define mutex_free(mutex) #define mutex_lock(mutex) #define mutex_unlock(mutex) @@ -556,7 +556,7 @@ #endif - mx_lock = mutex_alloc(); + mutex_alloc(mx_lock); persistent_servers = malloc(sizeof(TsHashTable)); persistent_sessions = malloc(sizeof(TsHashTable)); @@ -712,7 +712,7 @@ php_info_print_table_start(); php_info_print_table_row(2, OCI8 Support, enabled); - php_info_print_table_row(2, Revision, $Revision: 1.220 $); + php_info_print_table_row(2, Revision, $Revision: 1.221 $); sprintf(buf, %ld, num_persistent); php_info_print_table_row(2, Active Persistent Links, buf); @@ -2481,11 +2481,11 @@ smart_str_0(hashed_details); if (! exclusive) { - if (zend_ts_hash_find(persistent_sessions, hashed_details.c, hashed_details.len+1, session_list) != SUCCESS) { + if (zend_ts_hash_find(persistent_sessions, hashed_details.c, hashed_details.len+1, (void **) session_list) != SUCCESS) { zend_llist tmp; /* first session, set up a session list */ zend_llist_init(tmp, sizeof(oci_session), (llist_dtor_func_t) _session_pcleanup, 1); - zend_ts_hash_update(persistent_sessions, hashed_details.c, hashed_details.len+1, tmp, sizeof(zend_llist), session_list); + zend_ts_hash_update(persistent_sessions, hashed_details.c, hashed_details.len+1, tmp, sizeof(zend_llist), (void **) session_list); } else { mutex_lock(mx_lock); @@ -2683,8 +2683,11 @@ /* {{{ _oci_close_session() */ -static int _session_compare(oci_session *sess1, oci_session *sess2) +static int _session_compare(void *a, void *b) { + oci_session *sess1 = (oci_session*) a; + oci_session *sess2 = (oci_session*) b; + return sess1-num = sess2-num; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/com COM.c
phanto Thu Mar 27 14:56:09 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/com COM.c Log: fix #22899 invoke is called twice Index: php4/ext/com/COM.c diff -u php4/ext/com/COM.c:1.90.2.5 php4/ext/com/COM.c:1.90.2.6 --- php4/ext/com/COM.c:1.90.2.5 Mon Feb 24 13:30:19 2003 +++ php4/ext/com/COM.c Thu Mar 27 14:56:09 2003 @@ -18,7 +18,7 @@ | Wez Furlong [EMAIL PROTECTED] | +--+ */ -/* $Id: COM.c,v 1.90.2.5 2003/02/24 18:30:19 phanto Exp $ */ +/* $Id: COM.c,v 1.90.2.6 2003/03/27 19:56:09 phanto Exp $ */ /* * This module implements support for COM components that support the IDispatch * interface. Both local (COM) and remote (DCOM) components can be accessed. @@ -124,7 +124,7 @@ if (C_ISREFD(obj)) { if (C_HASTLIB(obj)) { hr = C_TYPEINFO_VT(obj)-Invoke(C_TYPEINFO(obj), C_DISPATCH(obj), dispIdMember, wFlags, pDispParams, pVarResult, ExceptInfo, ArgErr); - if (FAILED(hr)) { + if (FAILED(hr) (hr != DISP_E_EXCEPTION)) { hr = C_DISPATCH_VT(obj)-Invoke(C_DISPATCH(obj), dispIdMember, IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, ExceptInfo, ArgErr); if (SUCCEEDED(hr)) { /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/com com_wrapper.c
phanto Thu Mar 27 14:56:58 2003 EDT Modified files: /php4/ext/rpc/com com_wrapper.c Log: MFB ext/com fix #22899 invoke is called twice Index: php4/ext/rpc/com/com_wrapper.c diff -u php4/ext/rpc/com/com_wrapper.c:1.91 php4/ext/rpc/com/com_wrapper.c:1.92 --- php4/ext/rpc/com/com_wrapper.c:1.91 Sat Feb 15 22:48:46 2003 +++ php4/ext/rpc/com/com_wrapper.c Thu Mar 27 14:56:58 2003 @@ -18,7 +18,7 @@ | Wez Furlong [EMAIL PROTECTED] | +--+ */ -/* $Id: com_wrapper.c,v 1.91 2003/02/16 03:48:46 wez Exp $ */ +/* $Id: com_wrapper.c,v 1.92 2003/03/27 19:56:58 phanto Exp $ */ /* * This module implements support for COM components that support the IDispatch * interface. Both local (COM) and remote (DCOM) components can be accessed. @@ -89,7 +89,7 @@ if (C_HASTLIB(obj)) { hr = C_TYPEINFO_VT(obj)-Invoke(C_TYPEINFO(obj), C_DISPATCH(obj), dispIdMember, wFlags, pDispParams, pVarResult, ExceptInfo, ArgErr); - if (FAILED(hr)) { + if (FAILED(hr) (hr != DISP_E_EXCEPTION)) { hr = C_DISPATCH_VT(obj)-Invoke(C_DISPATCH(obj), dispIdMember, IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, ExceptInfo, ArgErr); if (SUCCEEDED(hr)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4(PHP_4_3) /main main.c
because it is a rather small manageable security fix ? regards, Harald Radi -- nme - we can heal you http://www.nme.at Ortner Radi Schwenk GnbR Tumpenweg 528 5084 Grossgmain, Salzburg Austria -Original Message- From: Marcus Börger [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2003 11:59 AM To: Harald Radi Cc: [EMAIL PROTECTED] Subject: Re: [PHP-CVS] cvs: php4(PHP_4_3) /main main.c At 02:54 03.03.2003, Harald Radi wrote: phanto Sun Mar 2 20:54:29 2003 EDT Modified files: (Branch: PHP_4_3) /php4/main main.c Log: MFH: adding disable_classes ini directive Why was this *new functionality* MFHed? -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / php.ini-dist php.ini-recommended
phanto Sun Mar 2 20:30:28 2003 EDT Modified files: /php4 php.ini-dist php.ini-recommended Log: adding placeholder for the new disable_classes directive Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.182 php4/php.ini-dist:1.183 --- php4/php.ini-dist:1.182 Sun Mar 2 07:46:37 2003 +++ php4/php.ini-dist Sun Mar 2 20:30:27 2003 @@ -193,6 +193,11 @@ ; *NOT* affected by whether Safe Mode is turned On or Off. disable_functions = +; This directive allows you to disable certain classes for security reasons. +; It receives a comma-delimited list of class names. This directive is +; *NOT* affected by whether Safe Mode is turned On or Off. +disable_classes = + ; Colors for Syntax Highlighting mode. Anything that's acceptable in ; font color=?? would work. ;highlight.string = #DD Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.128 php4/php.ini-recommended:1.129 --- php4/php.ini-recommended:1.128 Sun Mar 2 07:46:37 2003 +++ php4/php.ini-recommendedSun Mar 2 20:30:27 2003 @@ -207,6 +207,11 @@ ; *NOT* affected by whether Safe Mode is turned On or Off. disable_functions = +; This directive allows you to disable certain classes for security reasons. +; It receives a comma-delimited list of class names. This directive is +; *NOT* affected by whether Safe Mode is turned On or Off. +disable_classes = + ; Colors for Syntax Highlighting mode. Anything that's acceptable in ; font color=?? would work. ;highlight.string = #DD -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / php.ini-dist php.ini-recommended
phanto Sun Mar 2 20:31:48 2003 EDT Modified files: (Branch: PHP_4_3) /php4 php.ini-dist php.ini-recommended Log: MFH: adding placeholder for the new disable_classes directive Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.171.2.5 php4/php.ini-dist:1.171.2.6 --- php4/php.ini-dist:1.171.2.5 Fri Jan 31 02:47:10 2003 +++ php4/php.ini-dist Sun Mar 2 20:31:48 2003 @@ -193,6 +193,11 @@ ; *NOT* affected by whether Safe Mode is turned On or Off. disable_functions = +; This directive allows you to disable certain classes for security reasons. +; It receives a comma-delimited list of class names. This directive is +; *NOT* affected by whether Safe Mode is turned On or Off. +disable_classes = + ; Colors for Syntax Highlighting mode. Anything that's acceptable in ; font color=?? would work. ;highlight.string = #DD Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.119.2.3 php4/php.ini-recommended:1.119.2.4 --- php4/php.ini-recommended:1.119.2.3 Thu Dec 26 08:27:08 2002 +++ php4/php.ini-recommendedSun Mar 2 20:31:48 2003 @@ -207,6 +207,11 @@ ; *NOT* affected by whether Safe Mode is turned On or Off. disable_functions = +; This directive allows you to disable certain classes for security reasons. +; It receives a comma-delimited list of class names. This directive is +; *NOT* affected by whether Safe Mode is turned On or Off. +disable_classes = + ; Colors for Syntax Highlighting mode. Anything that's acceptable in ; font color=?? would work. ;highlight.string = #DD -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /main main.c
phanto Sun Mar 2 20:54:29 2003 EDT Modified files: (Branch: PHP_4_3) /php4/main main.c Log: MFH: adding disable_classes ini directive Index: php4/main/main.c diff -u php4/main/main.c:1.512.2.12 php4/main/main.c:1.512.2.13 --- php4/main/main.c:1.512.2.12 Wed Feb 26 17:17:35 2003 +++ php4/main/main.cSun Mar 2 20:54:29 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.512.2.12 2003/02/26 22:17:35 rasmus Exp $ */ +/* $Id: main.c,v 1.512.2.13 2003/03/03 01:54:29 phanto Exp $ */ /* {{{ includes */ @@ -202,6 +202,44 @@ } /* }}} */ +/* {{{ php_disable_classes + */ +static void php_disable_classes(TSRMLS_D) +{ + char *s = NULL; + char *e = INI_STR(disable_classes); + char p; + + if (!*e) { + return; + } + + while (*e) { + switch (*e) { + case ' ': + case ',': + if (s) { + p = *e; + *e = '\0'; + zend_disable_class(s, e-s TSRMLS_CC); + *e = p; + s = NULL; + } + break; + default: + if (!s) { + s = e; + } + break; + } + e++; + } + if (s) { + zend_disable_class(s, e-s TSRMLS_CC); + } +} +/* }}} */ + /* {{{ PHP_INI_MH */ static PHP_INI_MH(OnUpdateTimeout) @@ -324,6 +362,7 @@ PHP_INI_ENTRY(sendmail_from, NULL, PHP_INI_ALL,NULL) PHP_INI_ENTRY(sendmail_path, DEFAULT_SENDMAIL_PATH, PHP_INI_SYSTEM, NULL) PHP_INI_ENTRY(disable_functions, , PHP_INI_SYSTEM, NULL) + PHP_INI_ENTRY(disable_classes,, PHP_INI_SYSTEM, NULL) STD_PHP_INI_BOOLEAN(allow_url_fopen, 1,PHP_INI_ALL, OnUpdateBool, allow_url_fopen, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(always_populate_raw_post_data,0, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals) @@ -1178,8 +1217,9 @@ */ php_ini_delayed_modules_startup(TSRMLS_C); - /* disable certain functions as requested by php.ini */ + /* disable certain classes and functions as requested by php.ini */ php_disable_functions(TSRMLS_C); + php_disable_classes(TSRMLS_C); /* start Zend extensions */ zend_startup_extensions(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /win32 php5ts.dsw
phanto Wed Feb 19 06:04:55 2003 EDT Removed files: (Branch: PHP_4_3) /php4/win32 php5ts.dsw Log: remove php5ts workspace from PHP_4_3 branch -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main main.c
phanto Wed Feb 19 11:17:16 2003 EDT Modified files: /php4/main main.c Log: prevent xdebug from crashing Index: php4/main/main.c diff -u php4/main/main.c:1.527 php4/main/main.c:1.528 --- php4/main/main.c:1.527 Tue Feb 18 04:37:54 2003 +++ php4/main/main.cWed Feb 19 11:17:15 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.527 2003/02/18 09:37:54 wez Exp $ */ +/* $Id: main.c,v 1.528 2003/02/19 16:17:15 phanto Exp $ */ /* {{{ includes */ @@ -1064,6 +1064,10 @@ void php_request_shutdown(void *dummy) { TSRMLS_FETCH(); + + /* EG(opline_ptr) points into nirvana and therefore cannot be safely accessed + inside zend_executor callback functions. */ + EG(opline_ptr) = NULL; zend_try { php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /main main.c
phanto Wed Feb 19 11:17:34 2003 EDT Modified files: (Branch: PHP_4_3) /php4/main main.c Log: MFH Index: php4/main/main.c diff -u php4/main/main.c:1.512.2.10 php4/main/main.c:1.512.2.11 --- php4/main/main.c:1.512.2.10 Sat Feb 15 15:23:12 2003 +++ php4/main/main.cWed Feb 19 11:17:34 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.512.2.10 2003/02/15 20:23:12 sniper Exp $ */ +/* $Id: main.c,v 1.512.2.11 2003/02/19 16:17:34 phanto Exp $ */ /* {{{ includes */ @@ -915,6 +915,10 @@ void php_request_shutdown(void *dummy) { TSRMLS_FETCH(); + + /* EG(opline_ptr) points into nirvana and therefore cannot be safely accessed + inside zend_executor callback functions. */ + EG(opline_ptr) = NULL; zend_try { php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/standard info.c
phanto Thu Feb 13 11:48:44 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard info.c Log: add missing include Index: php4/ext/standard/info.c diff -u php4/ext/standard/info.c:1.218.2.5 php4/ext/standard/info.c:1.218.2.6 --- php4/ext/standard/info.c:1.218.2.5 Sun Feb 2 10:51:37 2003 +++ php4/ext/standard/info.cThu Feb 13 11:48:44 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: info.c,v 1.218.2.5 2003/02/02 15:51:37 zeev Exp $ */ +/* $Id: info.c,v 1.218.2.6 2003/02/13 16:48:44 phanto Exp $ */ #include php.h #include php_ini.h @@ -33,6 +33,7 @@ #include php_main.h #include zend_globals.h /* needs ELS */ #include zend_extensions.h +#include zend_highlight.h #ifdef HAVE_SYS_UTSNAME_H #include sys/utsname.h #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/skeleton skeleton.c
phanto Mon Feb 10 15:58:29 2003 EDT Modified files: /php4/ext/rpc/skeleton skeleton.c Log: s/com/skeleton/ is not always a good idea Index: php4/ext/rpc/skeleton/skeleton.c diff -u php4/ext/rpc/skeleton/skeleton.c:1.4 php4/ext/rpc/skeleton/skeleton.c:1.5 --- php4/ext/rpc/skeleton/skeleton.c:1.4Thu Jan 16 13:46:58 2003 +++ php4/ext/rpc/skeleton/skeleton.cMon Feb 10 15:58:29 2003 @@ -30,7 +30,7 @@ static int skeleton_call(rpc_string, void **, zval *, int, zval ***); static int skeleton_get(rpc_string, zval *, void **); static int skeleton_set(rpc_string, zval *, void **); -static int skeleton_skeletonpare(void **, void **); +static int skeleton_compare(void **, void **); static int skeleton_has_property(rpc_string, void **); static int skeleton_unset_property(rpc_string, void **); static int skeleton_get_properties(HashTable **, void **); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/com com.c com_wrapper.c conversion.c variant.c variant.h
phanto Mon Feb 10 15:58:53 2003 EDT Modified files: /php4/ext/rpc/com com.c com_wrapper.c conversion.c variant.c variant.h Log: a bunch of fixes Index: php4/ext/rpc/com/com.c diff -u php4/ext/rpc/com/com.c:1.19 php4/ext/rpc/com/com.c:1.20 --- php4/ext/rpc/com/com.c:1.19 Mon Feb 10 15:30:23 2003 +++ php4/ext/rpc/com/com.c Mon Feb 10 15:58:53 2003 @@ -36,13 +36,13 @@ static int com_ctor(rpc_string, void **, int , zval ***); static int com_dtor(void *); static int com_describe(rpc_string, void *, char **, unsigned char **); -static int com_call(rpc_string, void **, zval *, int, zval ***); -static int com_get(rpc_string, zval *, void **); -static int com_set(rpc_string, zval *, void **); -static int com_compare(void **, void **); -static int com_has_property(rpc_string, void **); -static int com_unset_property(rpc_string, void **); -static int com_get_properties(HashTable **, void **); +static int com_call(rpc_string, void *, zval *, int, zval ***); +static int com_get(rpc_string, zval *, void *); +static int com_set(rpc_string, zval *, void *); +static int com_compare(void *, void *); +static int com_has_property(rpc_string, void *); +static int com_unset_property(rpc_string, void *); +static int com_get_properties(HashTable **, void *); static PHP_INI_MH(com_typelib_file_change); @@ -216,13 +216,21 @@ switch (type) { case CLASS: { - OLECHAR *olestr; + if (hash.str != NULL) { + OLECHAR *olestr; - StringFromCLSID((CLSID *) hash.str, olestr); - name-str = php_OLECHAR_to_char(olestr, (name-len), CP_ACP, TRUE); - CoTaskMemFree(olestr); + StringFromCLSID((CLSID *) hash.str, olestr); + name-str = php_OLECHAR_to_char(olestr, +(name-len), CP_ACP, TRUE); + CoTaskMemFree(olestr); - return SUCCESS; + return SUCCESS; + } else { + comval *obj = (comval *) data; + + /* try to figure out classname */ + + return FAILURE; + } } case METHOD: @@ -620,9 +628,8 @@ return retval; } -static int com_call(rpc_string method_name, void **data, zval *return_value, int num_args, zval **args[]) +static int com_call(rpc_string method_name, void *data, zval *return_value, int +num_args, zval **args[]) { - DISPID dispid; DISPPARAMS dispparams; HRESULT hr; OLECHAR *funcname = NULL; @@ -630,17 +637,15 @@ VARIANT result; int current_arg, current_variant; char *ErrString = NULL; - TSRMLS_FETCH(); /* if the length of the name is 0, we are dealing with a pointer to a dispid */ assert(method_name.len == 0); - dispid = *(DISPID*)method_name.str; variant_args = num_args ? (VARIANT *) emalloc(sizeof(VARIANT) * num_args) : NULL; for (current_arg = 0; current_arg num_args; current_arg++) { current_variant = num_args - current_arg - 1; - php_zval_to_variant(*args[current_arg], variant_args[current_variant], C_CODEPAGE((comval *) *data)); + php_zval_to_variant(*args[current_arg], +variant_args[current_variant], C_CODEPAGE((comval *) data)); } dispparams.rgvarg = variant_args; @@ -650,7 +655,7 @@ VariantInit(result); - hr = php_COM_invoke((comval *) *data, dispid, DISPATCH_METHOD|DISPATCH_PROPERTYGET, dispparams, result, ErrString); + hr = php_COM_invoke((comval *) data, *(DISPID*)method_name.str, +DISPATCH_METHOD|DISPATCH_PROPERTYGET, dispparams, result, ErrString); for (current_arg=0;current_argnum_args;current_arg++) { /* don't release IDispatch pointers as they are used afterwards */ @@ -670,45 +675,26 @@ error_message = php_COM_error_message(hr); if (ErrString) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,Invoke() failed: %s %s, error_message, ErrString); + rpc_error(E_WARNING,Invoke() failed: %s %s, error_message, +ErrString); efree(ErrString); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING,Invoke() failed: %s, error_message); + rpc_error(E_WARNING,Invoke() failed: %s, error_message); } LocalFree(error_message); return FAILURE; } - RETVAL_VARIANT(result,
[PHP-CVS] cvs: php4 /ext/rpc handler.h php_rpc.h rpc.c rpc.h rpc_proxy.c
phanto Mon Feb 10 15:59:11 2003 EDT Modified files: /php4/ext/rpc handler.h php_rpc.h rpc.c rpc.h rpc_proxy.c Log: a bunch of fixes Index: php4/ext/rpc/handler.h diff -u php4/ext/rpc/handler.h:1.15 php4/ext/rpc/handler.h:1.16 --- php4/ext/rpc/handler.h:1.15 Sun Feb 9 16:37:40 2003 +++ php4/ext/rpc/handler.h Mon Feb 10 15:59:10 2003 @@ -82,13 +82,13 @@ int (*rpc_ctor)(rpc_string class_name, void **data, int num_args, zval **args[]); int (*rpc_dtor)(void *data); int (*rpc_describe)(rpc_string method_name, void *data, char **arg_types, unsigned char **ref_types); - int (*rpc_call)(rpc_string method_name, void **data, zval *return_value, int num_args, zval **args[]); - int (*rpc_get)(rpc_string property_name, zval *return_value, void **data); - int (*rpc_set)(rpc_string property_name, zval *value, void **data); - int (*rpc_compare)(void **data1, void **data2); - int (*rpc_has_property)(rpc_string property_name, void **data); - int (*rpc_unset_property)(rpc_string property_name, void **data); - int (*rpc_get_properties)(HashTable **properties, void **data); + int (*rpc_call)(rpc_string method_name, void *data, zval *return_value, int +num_args, zval **args[]); + int (*rpc_get)(rpc_string property_name, zval *return_value, void *data); + int (*rpc_set)(rpc_string property_name, zval *value, void *data); + int (*rpc_compare)(void *data1, void *data2); + int (*rpc_has_property)(rpc_string property_name, void *data); + int (*rpc_unset_property)(rpc_string property_name, void *data); + int (*rpc_get_properties)(HashTable **properties, void *data); } rpc_object_handlers; /* handler entry */ @@ -127,8 +127,17 @@ zend_uint dummy; } rpc_proxy; + +ZEND_API ZEND_FUNCTION(rpc_load); +ZEND_API ZEND_FUNCTION(rpc_call); +ZEND_API ZEND_FUNCTION(rpc_set); +ZEND_API ZEND_FUNCTION(rpc_get); +ZEND_API ZEND_FUNCTION(rpc_singleton); +ZEND_API ZEND_FUNCTION(rpc_poolable); + ZEND_API rpc_register_layer(rpc_handler_entry *entry TSRMLS_DC); -ZEND_API zval* _rpc_object_from_data(zval *z, zend_class_entry *ce, void *data, rpc_class_hash *class_hash TSRMLS_DC); -#define rpc_object_from_data(z, layer, data, class_hash) _rpc_object_from_data((z), layer##_class_entry, (data), (class_hash) TSRMLS_CC) +ZEND_API zval* _rpc_object_from_data(zval *z, rpc_handler_entry *handler, void *data, +rpc_class_hash *class_hash); +#define rpc_object_from_data(layer, data) rpc_object_from_data_ex(NULL, layer, data, +NULL) +#define rpc_object_from_data_ex(z, layer, data, class_hash) +_rpc_object_from_data((z), layer##_handler_entry, (data), (class_hash)) #endif /* HANDLER_H */ Index: php4/ext/rpc/php_rpc.h diff -u php4/ext/rpc/php_rpc.h:1.9 php4/ext/rpc/php_rpc.h:1.10 --- php4/ext/rpc/php_rpc.h:1.9 Thu Jan 16 12:49:20 2003 +++ php4/ext/rpc/php_rpc.h Mon Feb 10 15:59:10 2003 @@ -34,13 +34,6 @@ ZEND_RSHUTDOWN_FUNCTION(rpc); ZEND_MINFO_FUNCTION(rpc); -ZEND_API ZEND_FUNCTION(rpc_load); -ZEND_API ZEND_FUNCTION(rpc_call); -ZEND_API ZEND_FUNCTION(rpc_set); -ZEND_API ZEND_FUNCTION(rpc_get); -ZEND_API ZEND_FUNCTION(rpc_singleton); -ZEND_API ZEND_FUNCTION(rpc_poolable); - ZEND_API void rpc_error(int type, const char *format, ...); ZEND_API zend_object_value rpc_objects_new(zend_class_entry * TSRMLS_DC); Index: php4/ext/rpc/rpc.c diff -u php4/ext/rpc/rpc.c:1.21 php4/ext/rpc/rpc.c:1.22 --- php4/ext/rpc/rpc.c:1.21 Mon Feb 10 07:36:06 2003 +++ php4/ext/rpc/rpc.c Mon Feb 10 15:59:10 2003 @@ -36,8 +36,10 @@ static void rpc_objects_delete(void *, zend_object_handle TSRMLS_DC); static void rpc_ini_cb(void *arg TSRMLS_DC); +static rpc_class_hash *rpc_class_hash_find(rpc_string *name); + /* object handler */ -static zval* rpc_read(zval *, zval *, int TSRMLS_DC); +static zval* rpc_read(zval *, zval * TSRMLS_DC); static void rpc_write(zval *, zval *, zval * TSRMLS_DC); static zval** rpc_get_property(zval *, zval * TSRMLS_DC); static zval* rpc_get(zval * TSRMLS_DC); @@ -283,7 +285,7 @@ } } -static zval* rpc_read(zval *object, zval *member, int type TSRMLS_DC) +static zval* rpc_read(zval *object, zval *member TSRMLS_DC) { zval *return_value; GET_INTERNAL(intern); @@ -439,7 +441,6 @@ zend_uint num_args = ZEND_NUM_ARGS(); zend_class_entry overloaded_class_entry; rpc_class_hash *class_hash; - rpc_class_hash **class_hash_find = NULL; rpc_internal *intern; rpc_string hash_val, class_val; int retval, append = 0; @@ -493,16 +494,10 @@ GET_SIGNATURE(intern, class_val.str, class_val.len, hash_val, num_args, arg_types); /* check if already hashed */ - if (zend_ts_hash_find(classes, hash_val.str, hash_val.len + 1, (void **) class_hash_find) != SUCCESS) { -
[PHP-CVS] cvs: php4 /ext/rpc/com com.c com.h
phanto Mon Feb 10 19:54:26 2003 EDT Modified files: /php4/ext/rpc/com com.c com.h Log: improved reverse lookup of ProgID based on an IDispatch pointer Index: php4/ext/rpc/com/com.c diff -u php4/ext/rpc/com/com.c:1.20 php4/ext/rpc/com/com.c:1.21 --- php4/ext/rpc/com/com.c:1.20 Mon Feb 10 15:58:53 2003 +++ php4/ext/rpc/com/com.c Mon Feb 10 19:54:25 2003 @@ -28,6 +28,7 @@ #include variant.h #include ext/standard/php_smart_str.h #include oleauto.h +#include ocidl.h /* protos */ @@ -44,7 +45,7 @@ static int com_unset_property(rpc_string, void *); static int com_get_properties(HashTable **, void *); -static PHP_INI_MH(com_typelib_file_change); +static ZEND_INI_MH(com_typelib_file_change); /* globals */ static IBindCtx *pBindCtx; @@ -88,6 +89,7 @@ ZEND_FE(com_skip, NULL) ZEND_FE(com_event_sink, arg1and2_force_ref) ZEND_FE(com_message_pump, NULL) + ZEND_FE(com_load_typelib, NULL) ZEND_FE(com_print_typeinfo, NULL) RPC_FUNCTION_ENTRY_END() @@ -149,28 +151,59 @@ static int com_hash(rpc_string name, rpc_string *hash, void *data, int num_args, char *arg_types, int type) { - OLECHAR *olestr = php_char_to_OLECHAR(name.str, name.len, CP_ACP, FALSE); - switch (type) { case CLASS: { CLSID *clsid = malloc(sizeof(CLSID)); - if (FAILED(CLSIDFromString(olestr, clsid))) { - /* Perhaps this is a Moniker? */ - free(clsid); + /* if name is {NULL, 0} then the corresponding hash value has +to be figured out +* of the *data struct. this might be not a trivial task. +*/ + if (name.str) { + OLECHAR *olestr = php_char_to_OLECHAR(name.str, +name.len, CP_ACP, FALSE); + + if (FAILED(CLSIDFromString(olestr, clsid))) { + /* Perhaps this is a Moniker? */ + free(clsid); + efree(olestr); + + hash-str = strdup(name.str); + hash-len = name.len; + + return SUCCESS; + } - hash-str = strdup(name.str); - hash-len = name.len; + efree(olestr); } else { - hash-str = (char *) clsid; - /* str is actually not a string but a CLSID struct, thus set len to 0. -* nevertheless clsid is freed by the rpc_string_dtor -*/ - hash-len = 0; + comval *obj = (comval *)data; + IProvideClassInfo2 *pci2; + + if +(SUCCEEDED(C_DISPATCH_VT(obj)-QueryInterface(C_DISPATCH(obj), +IID_IProvideClassInfo2, (void**)pci2))) { + if (FAILED(pci2-lpVtbl-GetGUID(pci2, +GUIDKIND_DEFAULT_SOURCE_DISP_IID, clsid))) { + free(clsid); + + return FAILURE; + } + pci2-lpVtbl-Release(pci2); + } else if (C_HASTLIB(obj)) { + TYPEATTR *typeattrib; + + if +(FAILED(C_TYPEINFO_VT(obj)-GetTypeAttr(C_TYPEINFO(obj), typeattrib))) { + free(clsid); + + return FAILURE; + } + + *clsid = (typeattrib-guid); + +C_TYPEINFO_VT(obj)-ReleaseTypeAttr(C_TYPEINFO(obj), typeattrib); + } } - efree(olestr); + hash-str = (char *) clsid; + /* str is actually not a string but a CLSID struct, thus set +len to 0. + * nevertheless clsid is freed by the rpc_string_dtor + */ + hash-len = 0; return SUCCESS; } @@ -179,7 +212,8 @@ case PROPERTY: { DISPID *dispid = malloc(sizeof(DISPID)); - + OLECHAR *olestr = php_char_to_OLECHAR(name.str, name.len, +CP_ACP, FALSE); + if(SUCCEEDED(php_COM_get_ids_of_names((comval
[PHP-CVS] cvs: php4 /ext/rpc handler.h rpc.c rpc.h
phanto Mon Feb 10 19:55:27 2003 EDT Modified files: /php4/ext/rpc handler.h rpc.c rpc.h Log: clean up source and improve hashing for implicitly created objects (aka return values) Index: php4/ext/rpc/handler.h diff -u php4/ext/rpc/handler.h:1.16 php4/ext/rpc/handler.h:1.17 --- php4/ext/rpc/handler.h:1.16 Mon Feb 10 15:59:10 2003 +++ php4/ext/rpc/handler.h Mon Feb 10 19:55:26 2003 @@ -116,6 +116,7 @@ typedef struct _rpc_internal { MUTEX_T mx_handler; TsHashTable function_table; + zend_bool free_function_table; rpc_object_handlers **handlers; rpc_class_hash *hash; zend_class_entry*ce; Index: php4/ext/rpc/rpc.c diff -u php4/ext/rpc/rpc.c:1.22 php4/ext/rpc/rpc.c:1.23 --- php4/ext/rpc/rpc.c:1.22 Mon Feb 10 15:59:10 2003 +++ php4/ext/rpc/rpc.c Mon Feb 10 19:55:26 2003 @@ -229,6 +229,11 @@ RPC_HT(*intern)-rpc_dtor((*intern)-data); + tsrm_mutex_free((*intern)-mx_handler); + if ((*intern)-free_function_table) { + zend_ts_hash_destroy(((*intern)-function_table)); + } + pefree(*intern, TRUE); } @@ -439,7 +444,6 @@ zval *object = getThis(); zval ***args, ***args_free; zend_uint num_args = ZEND_NUM_ARGS(); - zend_class_entry overloaded_class_entry; rpc_class_hash *class_hash; rpc_internal *intern; rpc_string hash_val, class_val; @@ -474,7 +478,7 @@ GET_ARGS_EX(num_args, args, args_free, 1); /* if classname != integer */ - if ((zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 1 TSRMLS_CC, l, class_val.str) != SUCCESS) || + if ((zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 1 TSRMLS_CC, l, +class_val.len) != SUCCESS) || /* or we have no hash function */ !(RPC_HT(intern)-rpc_hash) || /* or integer hashing is not allowed */ @@ -495,12 +499,10 @@ /* check if already hashed */ if ((class_hash = rpc_class_hash_find(hash_val)) == NULL) { - rpc_class_hash **class_hash_find; - ALLOC_CLASS_HASH(class_hash, intern-handlers); /* do hashing */ - if (RPC_HT(intern)-rpc_hash(class_val, (rpc_string *)(class_hash), NULL, num_args, arg_types, CLASS) != SUCCESS) { + if (RPC_HT(intern)-rpc_hash(class_val, +(rpc_string *) class_hash, NULL, num_args, arg_types, CLASS) != SUCCESS) { /* TODO: exception */ ZVAL_NULL(object); return; @@ -508,39 +510,22 @@ /* overload class entry */ RPC_HT(intern)-rpc_name(class_val, class_val, NULL, CLASS); - INIT_CLASS_ENTRY(overloaded_class_entry, NULL, NULL); - overloaded_class_entry.name = class_val.str; - overloaded_class_entry.name_length = class_val.len; - class_hash-ce = zend_register_internal_class_ex(overloaded_class_entry, intern-ce, NULL TSRMLS_CC); - intern-ce = class_hash-ce; - intern-function_table.hash = intern-ce-function_table; + OVERLOAD_RPC_CLASS(class_val, intern, +class_hash); /* register with non-hashed key * also track all instaces in a llist for destruction later on, because there might be duplicate entries in * the hashtable and we can't determine if a pointer references to an already freed element */ - tsrm_mutex_lock(classes.mx_writer); - zend_ts_hash_add(classes, hash_val.str, hash_val.len + 1, class_hash, sizeof(rpc_class_hash *), (void **) class_hash_find); - zend_llist_add_element(classes_list, class_hash_find); - tsrm_mutex_unlock(classes.mx_writer); - - if (class_hash-name.str) { - /* register string hashcode */ - zend_ts_hash_add(classes, class_hash-name.str, class_hash-name.len + 1, class_hash, sizeof(rpc_class_hash *), NULL); -
[PHP-CVS] cvs: php4 /ext/rpc rpc.c
phanto Sun Feb 9 18:17:42 2003 EDT Modified files: /php4/ext/rpc rpc.c Log: fix a memleak Index: php4/ext/rpc/rpc.c diff -u php4/ext/rpc/rpc.c:1.19 php4/ext/rpc/rpc.c:1.20 --- php4/ext/rpc/rpc.c:1.19 Sun Feb 9 16:37:40 2003 +++ php4/ext/rpc/rpc.c Sun Feb 9 18:17:41 2003 @@ -794,12 +794,11 @@ ZEND_API zend_object_value rpc_objects_new(zend_class_entry *class_type TSRMLS_DC) { - zend_object_value *zov; + zend_object_value zov; rpc_internal *intern; /* set up the object value struct */ - zov = (zend_object_value*) pemalloc(sizeof(zend_object_value), TRUE); - zov-handlers = rpc_handlers; + zov.handlers = rpc_handlers; /* set up the internal representation of our rpc instance */ intern = (rpc_internal *) pecalloc(1, sizeof(rpc_internal), TRUE); @@ -816,9 +815,9 @@ /* TODO: exception */ } - zov-handle = zend_objects_store_put(intern, rpc_objects_delete, NULL TSRMLS_CC); + zov.handle = zend_objects_store_put(intern, rpc_objects_delete, NULL +TSRMLS_CC); - return *zov; + return zov; } /***/ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) / NEWS
phanto Sun Feb 9 19:58:08 2003 EDT Modified files: (Branch: PHP_4_3) /php4 NEWS Log: 18 times the speed of light Index: php4/NEWS diff -u php4/NEWS:1.1247.2.65 php4/NEWS:1.1247.2.66 --- php4/NEWS:1.1247.2.65 Sun Feb 9 17:56:47 2003 +++ php4/NEWS Sun Feb 9 19:58:07 2003 @@ -45,6 +45,7 @@ get_browser()). (Ilia) - Fixed bug #21442 (crash in mail() on Windows when 1st parameter is empty). (Edin) +- Fixed bug #21378 (COM code crashes after update 4.2.1 to 4.3.0). (Harald) - Fixed bug #21338 (html_entity_decode() crashed when is passed). (Ilia) - Fixed bug #21297 (in CLI/CGI sapis on the #! it would leave a \n when the the code encounters \r\n). (Ilia) @@ -59,6 +60,7 @@ - Fixed bug #20857 (snmpset() failed always, patch by: [EMAIL PROTECTED]). (Jani) - Fixed bug #20802 (PHP would die silently when memory limit reached). (Ilia) - Fixed bug #20503 (imagesetbrush() not available on Windows). (Edin) +- Fixed bug #20282 (COM memory leak). (Harald) - Fixed bug #17868 (multiple !--include-- used to include PHP files crashes). (Ilia) - Fixed bug #17448 (Print the message when OCI_SUCCESS_WITH_INFO is returned). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] Re: php4(PHP_4_3) /sapi/cgi cgi_main.c
if i don't disable cgi.fix_pathinfo then i only have the ORIG_* variables set but not the real ones. that breaks a whole bunch of my (and not only my) scripts. any explaination for that ? i'm using php-cig + iis (and commandline doesn't work either). harald Shane Caraveo [EMAIL PROTECTED] schrieb im Newsbeitrag news:cvsshane1043532166@cvsserver... shane Sat Jan 25 17:02:46 2003 EDT Modified files: (Branch: PHP_4_3) /php4/sapi/cgicgi_main.c Log: MFH fix bug 21261 putenv on some platforms requires we provide the memory cleanup env parsing logic fix bug 21367 missed optargs in a previous patch -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/standard basic_functions.c
phanto Tue Jan 28 18:46:13 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard basic_functions.c Log: moved to php4/main Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.543.2.5 php4/ext/standard/basic_functions.c:1.543.2.6 --- php4/ext/standard/basic_functions.c:1.543.2.5 Tue Dec 31 11:35:25 2002 +++ php4/ext/standard/basic_functions.c Tue Jan 28 18:46:13 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.543.2.5 2002/12/31 16:35:25 sebastian Exp $ */ +/* $Id: basic_functions.c,v 1.543.2.6 2003/01/28 23:46:13 phanto Exp $ */ #include php.h #include php_streams.h @@ -1098,10 +1098,6 @@ PHP_RINIT_FUNCTION(basic) { -#ifdef PHP_WIN32 - CoInitialize(NULL); -#endif - memset(BG(strtok_table), 0, 256); BG(strtok_string) = NULL; BG(strtok_zval) = NULL; @@ -1182,10 +1178,6 @@ if (BG(mmap_file)) { munmap(BG(mmap_file), BG(mmap_len)); } -#endif - -#ifdef PHP_WIN32 - CoUninitialize(); #endif return SUCCESS; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/com COM.c com.h conversion.c variant.h
phanto Tue Jan 28 19:10:01 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/com COM.c com.h conversion.c variant.h Log: fix for bug #20282 (and propably some of the other com bugs) #credits also go to tzm.de for sponsoring me Index: php4/ext/com/COM.c diff -u php4/ext/com/COM.c:1.90.2.1 php4/ext/com/COM.c:1.90.2.2 --- php4/ext/com/COM.c:1.90.2.1 Tue Dec 31 11:34:12 2002 +++ php4/ext/com/COM.c Tue Jan 28 19:10:00 2003 @@ -15,10 +15,10 @@ | Author: Zeev Suraski [EMAIL PROTECTED] | | Harald Radi [EMAIL PROTECTED] | | Alan Brown [EMAIL PROTECTED] | - | Wez Furlong [EMAIL PROTECTED] | + | Wez Furlong [EMAIL PROTECTED] | +--+ */ -/* $Id: COM.c,v 1.90.2.1 2002/12/31 16:34:12 sebastian Exp $ */ +/* $Id: COM.c,v 1.90.2.2 2003/01/29 00:10:00 phanto Exp $ */ /* * This module implements support for COM components that support the IDispatch * interface. Both local (COM) and remote (DCOM) components can be accessed. @@ -726,7 +726,7 @@ } } - RETURN_RESOURCE(zend_list_insert(obj, IS_COM)); + RETVAL_COM(obj); } /* }}} */ @@ -744,7 +744,7 @@ int current_arg, current_variant; unsigned long count; - if (C_HASENUM(obj) strstr(Z_STRVAL_P(function_name), next)) { + if (C_HASENUM(obj) strstr(Z_STRVAL_P(function_name), next)) { /* Grab one argument off the stack, allocate enough * VARIANTs * Get the IEnumVariant interface and call -Next(); @@ -918,6 +918,7 @@ return SUCCESS; } + /* {{{ proto mixed com_invoke_ex(int module, int invokeflags, string handler_name [, mixed arg [, mixed ...]]) Invokes a COM module */ PHP_FUNCTION(com_invoke_ex) @@ -947,17 +948,7 @@ dispflags = (WORD)Z_LVAL_P(invokeflags); /* obtain IDispatch interface */ - if (Z_TYPE_P(object) == IS_OBJECT (Z_OBJCE_P(object) == COM_class_entry || !strcmp(Z_OBJCE_P(object)-name, COM))) { - zval **tmp; - zend_hash_index_find(Z_OBJPROP_P(object), 0, (void**)tmp); - ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, comval, IS_COM); - } else if (Z_TYPE_P(object) == IS_RESOURCE) { - ZEND_FETCH_RESOURCE(obj, comval*, object, -1, comval, IS_COM); - } - if (obj == NULL) { - php_error(E_WARNING, %d is not a COM object handler, Z_LVAL_P(object)); - RETURN_NULL(); - } + FETCH_COM_SAFE(object, obj); ALLOC_VARIANT(var_result); @@ -998,12 +989,7 @@ function_name = arguments[1]; /* obtain IDispatch interface */ - convert_to_long(object); - obj = (comval *)zend_list_find(Z_LVAL_P(object), type); - if (!obj || (type != IS_COM)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, %s is not a COM object handler, Z_STRVAL_P(function_name)); - RETURN_NULL(); - } + FETCH_COM_SAFE(object, obj); /* obtain property/method handler */ convert_to_string_ex(function_name); @@ -1042,12 +1028,7 @@ } /* obtain IDispatch interface */ - convert_to_long_ex(object); - obj = (comval *)zend_list_find(Z_LVAL_P(object), type); - if (!obj || (type != IS_COM)) { - php_error(E_WARNING, %s(): %d is not a COM object handler, get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } + FETCH_COM_SAFE(object, obj); RETURN_LONG(php_COM_release(obj TSRMLS_CC)) } @@ -1072,13 +1053,7 @@ } /* obtain IDispatch interface */ - convert_to_long_ex(object); - obj = (comval *)zend_list_find(Z_LVAL_P(object), type); - if (!obj || (type != IS_COM)) - { - php_error(E_WARNING, %s(): %d is not a COM object handler, get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } + FETCH_COM_SAFE(object, obj); RETURN_LONG(php_COM_addref(obj TSRMLS_CC)); } @@ -1453,12 +1428,8 @@ RETURN_FALSE; } - if (Z_TYPE_P(arg1) == IS_OBJECT (Z_OBJCE_P(arg1) == COM_class_entry || !strcmp(Z_OBJCE_P(arg1)-name, COM))) { - zval **tmp; - zend_hash_index_find(Z_OBJPROP_P(arg1), 0, (void**)tmp); - ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, comval, IS_COM); - } else if (Z_TYPE_P(arg1) == IS_RESOURCE) { - ZEND_FETCH_RESOURCE(obj, comval*, arg1, -1, comval, IS_COM); + if (Z_TYPE_P(arg1) == IS_OBJECT) { + FETCH_COM_SAFE(arg1, obj); } else { convert_to_string(arg1); typelibname = Z_STRVAL_P(arg1); @@ -1492,14 +1463,8
[PHP-CVS] cvs: php4 /main main.c
phanto Tue Jan 28 19:47:31 2003 EDT Modified files: /php4/main main.c Log: MFPHP_4_3 Index: php4/main/main.c diff -u php4/main/main.c:1.523 php4/main/main.c:1.524 --- php4/main/main.c:1.523 Tue Jan 7 21:44:09 2003 +++ php4/main/main.cTue Jan 28 19:47:31 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.523 2003/01/08 02:44:09 iliaa Exp $ */ +/* $Id: main.c,v 1.524 2003/01/29 00:47:31 phanto Exp $ */ /* {{{ includes */ @@ -873,6 +873,10 @@ { int retval = SUCCESS; +#ifdef PHP_WIN32 + CoInitialize(NULL); +#endif + #if PHP_SIGCHILD signal(SIGCHLD, sigchld_handler); #endif @@ -1072,6 +1076,10 @@ zend_try { zend_unset_timeout(TSRMLS_C); } zend_end_try(); + +#ifdef PHP_WIN32 + CoUninitialize(); +#endif } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
phanto Tue Jan 28 19:49:09 2003 EDT Modified files: /php4/ext/standard basic_functions.c Log: MFPHP_4_3 Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.567 php4/ext/standard/basic_functions.c:1.568 --- php4/ext/standard/basic_functions.c:1.567 Tue Jan 28 19:07:01 2003 +++ php4/ext/standard/basic_functions.c Tue Jan 28 19:49:09 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.567 2003/01/29 00:07:01 iliaa Exp $ */ +/* $Id: basic_functions.c,v 1.568 2003/01/29 00:49:09 phanto Exp $ */ #include php.h #include php_streams.h @@ -1133,10 +1133,6 @@ PHP_RINIT_FUNCTION(basic) { -#ifdef PHP_WIN32 - CoInitialize(NULL); -#endif - memset(BG(strtok_table), 0, 256); BG(strtok_string) = NULL; BG(strtok_zval) = NULL; @@ -1227,10 +1223,6 @@ if (BG(mmap_file)) { munmap(BG(mmap_file), BG(mmap_len)); } -#endif - -#ifdef PHP_WIN32 - CoUninitialize(); #endif return SUCCESS; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/com COM.c
phanto Tue Jan 28 19:59:54 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/com COM.c Log: fix warnings Index: php4/ext/com/COM.c diff -u php4/ext/com/COM.c:1.90.2.2 php4/ext/com/COM.c:1.90.2.3 --- php4/ext/com/COM.c:1.90.2.2 Tue Jan 28 19:10:00 2003 +++ php4/ext/com/COM.c Tue Jan 28 19:59:54 2003 @@ -18,7 +18,7 @@ | Wez Furlong [EMAIL PROTECTED] | +--+ */ -/* $Id: COM.c,v 1.90.2.2 2003/01/29 00:10:00 phanto Exp $ */ +/* $Id: COM.c,v 1.90.2.3 2003/01/29 00:59:54 phanto Exp $ */ /* * This module implements support for COM components that support the IDispatch * interface. Both local (COM) and remote (DCOM) components can be accessed. @@ -973,7 +973,6 @@ pval **arguments; pval *object, *function_name; comval *obj; - int type; int arg_count = ZEND_NUM_ARGS(); VARIANT *var_result; @@ -1016,7 +1015,6 @@ { pval *object; comval *obj; - int type; int arg_count = ZEND_NUM_ARGS(); if (arg_count != 1) { @@ -1041,7 +1039,6 @@ { pval *object; comval *obj; - int type; int arg_count = ZEND_NUM_ARGS(); if (arg_count != 1) { @@ -2309,9 +2306,7 @@ PHP_FUNCTION(com_isenum) { pval *object; - pval **comval_handle; comval *obj; - int type; if (ZEND_NUM_ARGS() != 1) { ZEND_WRONG_PARAM_COUNT(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4(PHP_4_3) /ext/standardbasic_functions.c
yeah, ilia already told me, i moved it to request_startup|shutdown again. my issue was, that CoUninitialize() was called in the basic_functions shutdown handler during module shutdown, so the com module which was shut down after basic_functions segfaulted. now CoUninitialize() is called after all modules are shut down. regards, Harald Radi -- nme - we can heal you http://www.nme.at Ortner Radi Schwenk GnbR Tumpenweg 528 5084 Grossgmain, Salzburg Austria -Original Message- From: Frank M. Kromann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 12:46 AM To: Harald Radi Cc: [EMAIL PROTECTED] Subject: Re: [PHP-CVS] cvs: php4(PHP_4_3) /ext/standardbasic_functions.c Are you sure this will work with ISAPI ? IIRC, CoInitialize was moved from module init to resuest request init to stabilize ISAPI. - Frank phanto Tue Jan 28 18:46:13 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard basic_functions.c Log: moved to php4/main Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.543.2.5 php4/ext/standard/basic_functions.c:1.543.2.6 --- php4/ext/standard/basic_functions.c:1.543.2.5 Tue Dec 31 11:35:25 2002 +++ php4/ext/standard/basic_functions.c Tue Jan 28 18:46:13 2003 @@ -17,7 +17,7 @@ +- -+ */ -/* $Id: basic_functions.c,v 1.543.2.5 2002/12/31 16:35:25 sebastian Exp $ */ +/* $Id: basic_functions.c,v 1.543.2.6 2003/01/28 23:46:13 phanto Exp $ */ #include php.h #include php_streams.h @@ -1098,10 +1098,6 @@ PHP_RINIT_FUNCTION(basic) { -#ifdef PHP_WIN32 - CoInitialize(NULL); -#endif - memset(BG(strtok_table), 0, 256); BG(strtok_string) = NULL; BG(strtok_zval) = NULL; @@ -1182,10 +1178,6 @@ if (BG(mmap_file)) { munmap(BG(mmap_file), BG(mmap_len)); } -#endif - -#ifdef PHP_WIN32 - CoUninitialize(); #endif return SUCCESS; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main php_ini.c
phanto Sun Jan 19 07:17:38 2003 EDT Modified files: /php4/main php_ini.c Log: ini patch to allow 'entry[] = value' entries Index: php4/main/php_ini.c diff -u php4/main/php_ini.c:1.108 php4/main/php_ini.c:1.109 --- php4/main/php_ini.c:1.108 Tue Dec 31 10:58:53 2002 +++ php4/main/php_ini.c Sun Jan 19 07:17:38 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ini.c,v 1.108 2002/12/31 15:58:53 sebastian Exp $ */ +/* $Id: php_ini.c,v 1.109 2003/01/19 12:17:38 phanto Exp $ */ /* Check CWD for php.ini */ #define INI_CHECK_CWD @@ -195,6 +195,34 @@ } } break; + + case ZEND_INI_PARSER_POP_ENTRY: { + zval *hash; + zval **find_hash; + zval *element; + + if (!arg2) { + /* bare string - nothing to do */ + break; + } + + if (zend_hash_find(configuration_hash, +Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, (void **) find_hash) == FAILURE) { + ALLOC_ZVAL(hash); + array_init(hash); + + zend_hash_update(configuration_hash, +Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, hash, sizeof(zval *), NULL); + } else { + hash = *find_hash; + } + + ALLOC_ZVAL(element); + *element = *arg2; + zval_copy_ctor(element); + INIT_PZVAL(element); + add_next_index_zval(hash, element); + + } + break; + case ZEND_INI_PARSER_SECTION: break; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
phanto Sun Jan 19 07:18:46 2003 EDT Modified files: /php4/ext/standard basic_functions.c Log: ini patch to allow 'entry[] = value' entries Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.563 php4/ext/standard/basic_functions.c:1.564 --- php4/ext/standard/basic_functions.c:1.563 Sat Jan 18 10:03:00 2003 +++ php4/ext/standard/basic_functions.c Sun Jan 19 07:18:46 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.563 2003/01/18 15:03:00 andrey Exp $ */ +/* $Id: basic_functions.c,v 1.564 2003/01/19 12:18:46 phanto Exp $ */ #include php.h #include php_streams.h @@ -2824,51 +2824,60 @@ zend_hash_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, element, sizeof(zval *), NULL); break; - case ZEND_INI_PARSER_SECTION: - break; - } -} - -static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, int callback_type, zval *arr) -{ - zval *element; - TSRMLS_FETCH(); - - switch (callback_type) { - - case ZEND_INI_PARSER_ENTRY: + case ZEND_INI_PARSER_POP_ENTRY: { - zval *active_arr; + zval *hash, **find_hash; if (!arg2) { /* bare string - nothing to do */ break; } - if (BG(active_ini_file_section)) { - active_arr = BG(active_ini_file_section); + if (zend_hash_find(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), +Z_STRLEN_P(arg1)+1, (void **) find_hash) == FAILURE) { + ALLOC_ZVAL(hash); + INIT_PZVAL(hash); + array_init(hash); + + zend_hash_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), +Z_STRLEN_P(arg1)+1, hash, sizeof(zval *), NULL); } else { - active_arr = arr; + hash = *find_hash; } + ALLOC_ZVAL(element); *element = *arg2; zval_copy_ctor(element); INIT_PZVAL(element); - zend_hash_update(Z_ARRVAL_P(active_arr), Z_STRVAL_P(arg1), -Z_STRLEN_P(arg1)+1, element, -sizeof(zval *), NULL); + add_next_index_zval(hash, element); } break; case ZEND_INI_PARSER_SECTION: - MAKE_STD_ZVAL(BG(active_ini_file_section)); - array_init(BG(active_ini_file_section)); - zend_hash_update( Z_ARRVAL_P(arr), - Z_STRVAL_P(arg1), - Z_STRLEN_P(arg1)+1, - BG(active_ini_file_section), - sizeof(zval *), NULL); break; + } +} + +static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, int +callback_type, zval *arr) +{ + TSRMLS_FETCH(); + + if (callback_type == ZEND_INI_PARSER_SECTION) { + MAKE_STD_ZVAL(BG(active_ini_file_section)); + array_init(BG(active_ini_file_section)); + zend_hash_update( Z_ARRVAL_P(arr), + Z_STRVAL_P(arg1), + Z_STRLEN_P(arg1)+1, + BG(active_ini_file_section), + sizeof(zval *), NULL); + } else if (arg2) { + zval *active_arr; + + if (BG(active_ini_file_section)) { + active_arr = BG(active_ini_file_section); + } else { + active_arr = arr; + } + + php_simple_ini_parser_cb(arg1, arg2, callback_type, active_arr); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc handler.h layer.h php_rpc.h rpc.c rpc.h /ext/rpc/com com.c com.h php_com.h /ext/rpc/skeleton skeleton.c skeleton.h
FOREACH_HANDLER for (__handler_counter=0; __handler_counter HANDLER_COUNT; __handler_counter++) -#define HANDLER handler_entries[__handler_counter] -#define HANDLER_COUNT (sizeof(handler_entries) / sizeof(rpc_handler_entry)) - #define RPC_HT(intern) (*((intern)-handlers)) #define RPC_CLASS(intern) ((intern)-hash) @@ -126,7 +122,5 @@ #define FREE_SIGNATURE(hash_val, arg_types) \ efree(arg_types); \ efree(hash_val.str); - -static int __handler_counter; #endif Index: php4/ext/rpc/com/php_com.h diff -u /dev/null php4/ext/rpc/com/php_com.h:1.14 --- /dev/null Thu Jan 16 12:49:21 2003 +++ php4/ext/rpc/com/php_com.h Thu Jan 16 12:49:21 2003 @@ -0,0 +1,25 @@ +/* + +--+ + | PHP Version 4| + +--+ + | Copyright (c) 1997-2003 The PHP Group| + +--+ + | This source file is subject to version 2.02 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is| + | available at through the world-wide-web at | + | http://www.php.net/license/2_02.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | [EMAIL PROTECTED] so we can mail you a copy immediately. | + +--+ + | Author: Harald Radi [EMAIL PROTECTED] | + +--+ + */ + +#ifndef PHP_COM_H +#define PHP_COM_H + +extern zend_module_entry com_module_entry; +#define phpext_com_ptr com_module_entry + +#endif /* PHP_COM_H */ \ No newline at end of file Index: php4/ext/rpc/com/com.c diff -u php4/ext/rpc/com/com.c:1.12 php4/ext/rpc/com/com.c:1.13 --- php4/ext/rpc/com/com.c:1.12 Tue Dec 31 11:07:22 2002 +++ php4/ext/rpc/com/com.c Thu Jan 16 12:49:20 2003 @@ -50,7 +50,7 @@ static unsigned char arg1and2_force_ref[] = { 2, BYREF_FORCE, BYREF_FORCE }; /* register rpc callback function */ -RPC_REGISTER_HANDLERS_START(com) +RPC_REGISTER_HANDLERS_BEGIN(com) TRUE, /* poolable */ HASH_AS_INT_WITH_SIGNATURE, com_hash, @@ -68,16 +68,16 @@ RPC_REGISTER_HANDLERS_END() /* register ini settings */ -RPC_INI_START(com) +PHP_INI_BEGIN() PHP_INI_ENTRY_EX(com.allow_dcom, 0, PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY_EX(com.autoregister_typelib, 0, PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY_EX(com.autoregister_verbose, 0, PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY_EX(com.autoregister_casesensitive, 1, PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY(com.typelib_file, , PHP_INI_SYSTEM, com_typelib_file_change) -RPC_INI_END() +PHP_INI_END() /* register userspace functions */ -RPC_FUNCTION_ENTRY_START(com) +RPC_FUNCTION_ENTRY_BEGIN(com) ZEND_FALIAS(com_invoke, rpc_call, NULL) ZEND_FE(com_addref, NULL) ZEND_FE(com_release,NULL) @@ -90,8 +90,21 @@ ZEND_FE(com_print_typeinfo, NULL) RPC_FUNCTION_ENTRY_END() +zend_module_entry com_module_entry = { + ZE2_STANDARD_MODULE_HEADER, + com, + RPC_FUNCTION_ENTRY(com), + ZEND_MINIT(com), + ZEND_MSHUTDOWN(com), + NULL, + NULL, + ZEND_MINFO(com), + 0.1a, + STANDARD_MODULE_PROPERTIES +}; + /* register class methods */ -RPC_METHOD_ENTRY_START(com) +RPC_METHOD_ENTRY_BEGIN(com) ZEND_FALIAS(addref, com_addref, NULL) ZEND_FALIAS(release,com_release,NULL) ZEND_FALIAS(next, com_next, NULL) @@ -101,20 +114,35 @@ RPC_METHOD_ENTRY_END() -/* init function that is called before the class is registered - * so you can do any tricky stuff in here - */ -RPC_INIT_FUNCTION(com) +ZEND_MINIT_FUNCTION(com) { CreateBindCtx(0, pBindCtx); php_variant_init(module_number TSRMLS_CC); + + RPC_REGISTER_LAYER(com); + REGISTER_INI_ENTRIES(); + + return SUCCESS; } -RPC_SHUTDOWN_FUNCTION(com) +ZEND_MSHUTDOWN_FUNCTION(com) { php_variant_shutdown(TSRMLS_C); pBindCtx-lpVtbl
[PHP-CVS] cvs: php4 /main config.w32.h
phanto Thu Jan 16 13:16:51 2003 EDT Modified files: /php4/main config.w32.h Log: prevent HEAD + ZE1 builds and add COM Index: php4/main/config.w32.h diff -u php4/main/config.w32.h:1.63 php4/main/config.w32.h:1.64 --- php4/main/config.w32.h:1.63 Wed Jan 15 11:53:49 2003 +++ php4/main/config.w32.h Thu Jan 16 13:16:50 2003 @@ -2,9 +2,13 @@ Build Configuration for Win32. This has only been tested with MS VisualC++ 6 (and later). - $Id: config.w32.h,v 1.63 2003/01/15 16:53:49 sebastian Exp $ + $Id: config.w32.h,v 1.64 2003/01/16 18:16:50 phanto Exp $ */ +#ifndef ZEND_ENGINE_2 +#error HEAD does not work with ZendEngine1 anymore +#endif + /* Default PHP / PEAR directories */ #define CONFIGURATION_FILE_PATH php.ini #define PEAR_INSTALLDIR c:\\php4\\pear @@ -34,6 +38,9 @@ /* Enable / Disable RPC extension (default: enabled) */ #define HAVE_RPC 1 + +/* Enable / Disable COM extension (default: enabled) */ +#define HAVE_COM 1 /* Enable / Disable CTYPE extension (default: enabled) */ #define HAVE_CTYPE 1 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc/skeleton php_skeleton.h skeleton.c skeleton.h
phanto Thu Jan 16 13:46:58 2003 EDT Added files: /php4/ext/rpc/skeleton php_skeleton.h Modified files: /php4/ext/rpc/skeleton skeleton.c skeleton.h Log: update skeleton Index: php4/ext/rpc/skeleton/skeleton.c diff -u php4/ext/rpc/skeleton/skeleton.c:1.3 php4/ext/rpc/skeleton/skeleton.c:1.4 --- php4/ext/rpc/skeleton/skeleton.c:1.3Thu Jan 16 12:49:21 2003 +++ php4/ext/rpc/skeleton/skeleton.cThu Jan 16 13:46:58 2003 @@ -56,40 +56,68 @@ skeleton_get, /* property get handler */ skeleton_set, /* property set handler */ skeleton_compare, /* compare handler, can be NULL */ -skeleton_has_property, /* reflection functions, -skeleton_unset_property,* can be NULL -skeleton_get_properties */ +skeleton_has_property, /* reflection functions */ +skeleton_unset_property, /* can be NULL */ +skeleton_get_properties RPC_REGISTER_HANDLERS_END() /* register ini settings */ -RPC_INI_START(skeleton) +PHP_INI_BEGIN() /* TODO: palce your ini entries here */ -RPC_INI_END() +PHP_INI_END() /* register userspace functions */ -RPC_FUNCTION_ENTRY_START(skeleton) +RPC_FUNCTION_ENTRY_BEGIN(skeleton) /* TODO: add your userspace functions here */ ZEND_FE(skeleton_function, NULL) RPC_FUNCTION_ENTRY_END() /* register class methods */ -RPC_METHOD_ENTRY_START(skeleton) +RPC_METHOD_ENTRY_BEGIN(skeleton) /* TODO: add your class methods here */ ZEND_FALIAS(method, skeleton_function, NULL) RPC_METHOD_ENTRY_END() -/* init function that is called before the class is registered - * so you can do any tricky stuff in here - */ -RPC_INIT_FUNCTION(skeleton) +zend_module_entry skeleton_module_entry = { + ZE2_STANDARD_MODULE_HEADER, + skeleton, + RPC_FUNCTION_ENTRY(skeleton), + ZEND_MINIT(skeleton), + ZEND_MSHUTDOWN(skeleton), + NULL, + NULL, + ZEND_MINFO(skeleton), + 0.1a, + STANDARD_MODULE_PROPERTIES +}; + +ZEND_MINIT_FUNCTION(skeleton) { /* TODO: place your init stuff here */ + + RPC_REGISTER_LAYER(skeleton); + REGISTER_INI_ENTRIES(); + + return SUCCESS; } -RPC_SHUTDOWN_FUNCTION(skeleton) +ZEND_MSHUTDOWN_FUNCTION(skeleton) { /* TODO: place your shutdown stuff here */ + + UNREGISTER_INI_ENTRIES(); + + return SUCCESS; } + +ZEND_MINFO_FUNCTION(skeleton) +{ + DISPLAY_INI_ENTRIES(); +} + +#ifdef COMPILE_DL_COM +ZEND_GET_MODULE(skeleton); +#endif /* rpc handler functions */ static int skeleton_hash(rpc_string name, rpc_string *hash, void *data, int num_args, char *arg_types, int type) Index: php4/ext/rpc/skeleton/skeleton.h diff -u php4/ext/rpc/skeleton/skeleton.h:1.3 php4/ext/rpc/skeleton/skeleton.h:1.4 --- php4/ext/rpc/skeleton/skeleton.h:1.3Thu Jan 16 12:49:21 2003 +++ php4/ext/rpc/skeleton/skeleton.hThu Jan 16 13:46:58 2003 @@ -24,6 +24,10 @@ RPC_DECLARE_HANDLER(skeleton); +ZEND_MINIT_FUNCTION(skeleton); +ZEND_MSHUTDOWN_FUNCTION(skeleton); +ZEND_MINFO_FUNCTION(skeleton); + /* TODO: define your functions here */ ZEND_FUNCTION(skeleton_function); /**/ Index: php4/ext/rpc/skeleton/php_skeleton.h +++ php4/ext/rpc/skeleton/php_skeleton.h /* +--+ | PHP Version 4| +--+ | Copyright (c) 1997-2003 The PHP Group| +--+ | This source file is subject to version 2.02 of the PHP license, | | that is bundled with this package in the file LICENSE, and is| | available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | [EMAIL PROTECTED] so we can mail you a copy immediately. | +--+ | Author: Harald Radi [EMAIL PROTECTED] | +--+ */ #ifndef PHP_SKELETON_H #define PHP_SKELETON_H extern zend_module_entry skeleton_module_entry; #define phpext_skeleton_ptr skeleton_module_entry #endif /* PHP_SKELETON_H */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/bcmath/libbcmath/src config.h
phanto Thu Jan 16 16:52:06 2003 EDT Modified files: /php4/ext/bcmath/libbcmath/src config.h Log: unbreak the build Index: php4/ext/bcmath/libbcmath/src/config.h diff -u php4/ext/bcmath/libbcmath/src/config.h:1.3 php4/ext/bcmath/libbcmath/src/config.h:1.4 --- php4/ext/bcmath/libbcmath/src/config.h:1.3 Wed Sep 4 07:20:18 2002 +++ php4/ext/bcmath/libbcmath/src/config.h Thu Jan 16 16:52:06 2003 @@ -1,3 +1,7 @@ +#include string.h +#include zend.h +#include zend_alloc.h + #if PHP_WIN32 #include ../../../../main/config.w32.h #elif defined(NETWARE) @@ -5,7 +9,3 @@ #else #include php_config.h #endif - -#include string.h -#include zend.h -#include zend_alloc.h -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/bcmath/libbcmath/src config.h
phanto Thu Jan 16 17:08:00 2003 EDT Modified files: /php4/ext/bcmath/libbcmath/src config.h Log: revert previous commit Index: php4/ext/bcmath/libbcmath/src/config.h diff -u php4/ext/bcmath/libbcmath/src/config.h:1.4 php4/ext/bcmath/libbcmath/src/config.h:1.5 --- php4/ext/bcmath/libbcmath/src/config.h:1.4 Thu Jan 16 16:52:06 2003 +++ php4/ext/bcmath/libbcmath/src/config.h Thu Jan 16 17:08:00 2003 @@ -1,7 +1,3 @@ -#include string.h -#include zend.h -#include zend_alloc.h - #if PHP_WIN32 #include ../../../../main/config.w32.h #elif defined(NETWARE) @@ -9,3 +5,7 @@ #else #include php_config.h #endif + +#include string.h +#include zend.h +#include zend_alloc.h -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/rpc .cvsignore CREDITS EXPERIMENTAL RPC_HOWTO handler.h hash.h layer.h php_rpc.h rpc.c rpc.h rpc_proxy.c rpc_proxy.h /ext/rpc/com .cvsignore CREDITS TODO com.c com.h com_wrapper.c com_wrapper.h conversion.c conversion.h dispatch.c variant.c variant.h /ext/rpc/dotnet .cvsignore CREDITS EXPERIMENTAL README dotnet.cpp dotnet.dsp dotnet.php php_dotnet.h /ext/rpc/java .cvsignore CREDITS EXPERIMENTAL Makefile.frag README config.m4 except.php java.c java.dsp jawt.php jver.php reflect.java /ext/rpc/skeleton skeleton.c skeleton.h /ext/rpc/tests test1.php test2.php test3.php test4.php tests.php /ext/rpc/xmlrpc .cvsignore CREDITS EXPERIMENTAL config.m4 php_xmlrpc.h xmlrpc-epi-php.c xmlrpc.dsp /ext/rpc/xmlrpc/libxmlrpc .cvsignore README acinclude.m4 base64.c base64.h encodings.c encodings.h queue.c queue.h simplestring.c simplestring.h system_methods.c system_methods_private.h xml_element.c xml_element.h xml_to_dandarpc.c xml_to_dandarpc.h xml_to_soap.c xml_to_soap.h xml_to_xmlrpc.c xml_to_xmlrpc.h xmlrpc.c xmlrpc.h xmlrpc.m4 xmlrpc_introspection.c xmlrpc_introspection.h xmlrpc_introspection_private.h xmlrpc_private.h xmlrpc_win32.h
phanto Wed Jan 15 16:52:28 2003 EDT Removed files: (Branch: PHP_4_3) /php4/ext/rpc .cvsignore CREDITS EXPERIMENTAL RPC_HOWTO handler.h hash.h layer.h php_rpc.h rpc.c rpc.h rpc_proxy.c rpc_proxy.h /php4/ext/rpc/com .cvsignore CREDITS TODO com.c com.h com_wrapper.c com_wrapper.h conversion.c conversion.h dispatch.c variant.c variant.h /php4/ext/rpc/dotnet.cvsignore CREDITS EXPERIMENTAL README dotnet.cpp dotnet.dsp dotnet.php php_dotnet.h /php4/ext/rpc/java .cvsignore CREDITS EXPERIMENTAL Makefile.frag README config.m4 except.php java.c java.dsp jawt.php jver.php reflect.java /php4/ext/rpc/skeleton skeleton.c skeleton.h /php4/ext/rpc/tests test1.php test2.php test3.php test4.php tests.php /php4/ext/rpc/xmlrpc.cvsignore CREDITS EXPERIMENTAL config.m4 php_xmlrpc.h xmlrpc-epi-php.c xmlrpc.dsp /php4/ext/rpc/xmlrpc/libxmlrpc .cvsignore README acinclude.m4 base64.c base64.h encodings.c encodings.h queue.c queue.h simplestring.c simplestring.h system_methods.c system_methods_private.h xml_element.c xml_element.h xml_to_dandarpc.c xml_to_dandarpc.h xml_to_soap.c xml_to_soap.h xml_to_xmlrpc.c xml_to_xmlrpc.h xmlrpc.c xmlrpc.h xmlrpc.m4 xmlrpc_introspection.c xmlrpc_introspection.h xmlrpc_introspection_private.h xmlrpc_private.h xmlrpc_win32.h Log: removing this stuff from the php 4.3 branch -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/overload .cvsignore CREDITS README config.m4 overload.c overload.dsp php_overload.h
At 00:40 11.01.2003, Harald Radi wrote: phanto Fri Jan 10 18:40:13 2003 EDT Removed files: /php4/ext/overload .cvsignore config.m4 CREDITS overload.c overload.dsp php_overload.h README Log: this is now implemented by the engine itself But now you removed it for ZE1, too. Wouldn't it be better to simply disable overload in ZE2 as we did until you removed it? overload is implemented in ZE2 itself, so why keep it in the sources twice ? harald -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc rpc.c rpc_proxy.c /ext/rpc/com variant.c
phanto Sat Jan 11 03:59:37 2003 EDT Modified files: /php4/ext/rpc rpc.c rpc_proxy.c /php4/ext/rpc/com variant.c Log: fix build Index: php4/ext/rpc/rpc.c diff -u php4/ext/rpc/rpc.c:1.15 php4/ext/rpc/rpc.c:1.16 --- php4/ext/rpc/rpc.c:1.15 Tue Dec 31 11:07:22 2002 +++ php4/ext/rpc/rpc.c Sat Jan 11 03:59:36 2003 @@ -66,8 +66,6 @@ NULL, rpc_get, rpc_set, - NULL, - NULL, rpc_has_property, rpc_unset_property, rpc_get_properties, @@ -139,6 +137,24 @@ zend_llist_init(classes_list, sizeof(rpc_class_hash **), rpc_class_dtor, TRUE); FOREACH_HANDLER { + /* + handle = DL_LOAD(path); + if (!handle) { +#ifndef ZEND_WIN32 + fprintf(stderr, Failed loading %s: %s\n, path, DL_ERROR()); +#else + fprintf(stderr, Failed loading %s\n, path); +#endif + return FAILURE; + } + + extension_version_info = (zend_extension_version_info *) +DL_FETCH_SYMBOL(handle, extension_version_info); + new_extension = (zend_extension *) DL_FETCH_SYMBOL(handle, +zend_extension_entry); + if (!extension_version_info || !new_extension) { + fprintf(stderr, %s doesn't appear to be a valid Zend extension\n, +path); + return FAILURE; + } +*/ zend_class_entry ce; HANDLER.rpc_handler_init(module_number TSRMLS_CC); @@ -155,7 +171,7 @@ /* register classes and functions */ *HANDLER.ce = zend_register_internal_class_ex(ce, rpc_entry, NULL TSRMLS_CC); - zend_register_functions(HANDLER.functions, NULL, MODULE_PERSISTENT TSRMLS_CC); + zend_register_functions(NULLHANDLER.functions, NULL, MODULE_PERSISTENT +TSRMLS_CC); zend_register_ini_entries(HANDLER.ini, module_number TSRMLS_CC); } Index: php4/ext/rpc/rpc_proxy.c diff -u php4/ext/rpc/rpc_proxy.c:1.5 php4/ext/rpc/rpc_proxy.c:1.6 --- php4/ext/rpc/rpc_proxy.c:1.5Tue Dec 31 11:07:22 2002 +++ php4/ext/rpc/rpc_proxy.cSat Jan 11 03:59:36 2003 @@ -52,8 +52,6 @@ NULL, rpc_proxy_get, rpc_proxy_set, - NULL, - NULL, rpc_proxy_has_property, rpc_proxy_unset_property, rpc_proxy_get_properties, Index: php4/ext/rpc/com/variant.c diff -u php4/ext/rpc/com/variant.c:1.34 php4/ext/rpc/com/variant.c:1.35 --- php4/ext/rpc/com/variant.c:1.34 Tue Dec 31 11:07:23 2002 +++ php4/ext/rpc/com/variant.c Sat Jan 11 03:59:36 2003 @@ -62,8 +62,6 @@ NULL, NULL, NULL, - NULL, - NULL, variant_get_constructor, variant_get_class_entry, NULL, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/com .cvsignore COM.c CREDITS TODO VARIANT.c com.h conversion.c conversion.h dispatch.c php_COM.h php_VARIANT.h variant.h
i remove ext/com and claimed that ext/rpc/com is used from now on, am i blind or what ? -Original Message- From: Sascha Schumann [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 11, 2003 10:33 AM To: Harald Radi Cc: [EMAIL PROTECTED]; 'Harald Radi'; [EMAIL PROTECTED] Subject: RE: [PHP-CVS] cvs: php4 /ext/com .cvsignore COM.c CREDITS TODO VARIANT.c com.h conversion.c conversion.h dispatch.c php_COM.h php_VARIANT.h variant.h so what's wrong ? You removed those files from the PHP 5 branch which you claimed were supposed to be used in the PHP 5 branch. - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/overload .cvsignore CREDITS README config.m4 overload.c overload.dsp php_overload.h
One more reason for what i said already: Then we should make HEAD builds against ZE1 impossible by configure. good point, i'll forward this to the super secret mailing list. and i am already using ZE2 a long time ... but testing with 4.2,4.3 releases requires i also have ZE1 builds. yup, and you can still get them by checking out the php 4.3 branch. harald -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main config.w32.h internal_functions_win32.c
phanto Fri Jan 10 18:35:52 2003 EDT Modified files: /php4/main config.w32.h internal_functions_win32.c Log: HEAD defaults to build with ZE2 now Index: php4/main/config.w32.h diff -u php4/main/config.w32.h:1.61 php4/main/config.w32.h:1.62 --- php4/main/config.w32.h:1.61 Sun Jan 5 10:58:28 2003 +++ php4/main/config.w32.h Fri Jan 10 18:35:52 2003 @@ -2,7 +2,7 @@ Build Configuration for Win32. This has only been tested with MS VisualC++ 6 (and later). - $Id: config.w32.h,v 1.61 2003/01/05 15:58:28 sebastian Exp $ + $Id: config.w32.h,v 1.62 2003/01/10 23:35:52 phanto Exp $ */ /* Default PHP / PEAR directories */ @@ -32,8 +32,8 @@ /* Enable / Disable CALENDAR extension (default: enabled) */ #define HAVE_CALENDAR 1 -/* Enable / Disable COM extension (default: enabled) */ -#define HAVE_COM 1 +/* Enable / Disable RPC extension (default: enabled) */ +#define HAVE_RPC 1 /* Enable / Disable CTYPE extension (default: enabled) */ #define HAVE_CTYPE 1 @@ -55,9 +55,6 @@ /* Enable / Disable ODBC extension (default: enabled) */ #define HAVE_UODBC 1 - -/* Enable / Disable OVERLOAD extension (default: enabled) */ -#define HAVE_OVERLOAD 1 /* Enable / Disable PCRE extension (default: enabled) */ #define HAVE_BUNDLED_PCRE 1 Index: php4/main/internal_functions_win32.c diff -u php4/main/internal_functions_win32.c:1.67 php4/main/internal_functions_win32.c:1.68 --- php4/main/internal_functions_win32.c:1.67 Tue Dec 31 10:58:51 2002 +++ php4/main/internal_functions_win32.cFri Jan 10 18:35:52 2003 @@ -16,7 +16,7 @@ | Zeev Suraski [EMAIL PROTECTED]| +--+ - $Id: internal_functions_win32.c,v 1.67 2002/12/31 15:58:51 sebastian Exp $ + $Id: internal_functions_win32.c,v 1.68 2003/01/10 23:35:52 phanto Exp $ */ /* {{{ includes @@ -54,8 +54,8 @@ #if HAVE_CTYPE #include ext/ctype/php_ctype.h #endif -#if HAVE_COM -#include ext/com/php_COM.h +#if HAVE_RPC +#include ext/rpc/php_rpc.h #endif #if HAVE_FTP #include ext/ftp/php_ftp.h @@ -82,11 +82,6 @@ #if HAVE_MBSTRING #include ext/mbstring/mbstring.h #endif -#ifndef ZEND_ENGINE_2 -#if HAVE_OVERLOAD -#include ext/overload/php_overload.h -#endif -#endif #if HAVE_TOKENIZER #include ext/tokenizer/php_tokenizer.h #endif @@ -108,8 +103,8 @@ #if HAVE_CTYPE ,phpext_ctype_ptr #endif -#if HAVE_COM - ,phpext_com_ptr +#if HAVE_RPC + ,phpext_rpc_ptr #endif #if HAVE_FTP ,phpext_ftp_ptr @@ -122,11 +117,6 @@ #endif #if HAVE_UODBC ,phpext_odbc_ptr -#endif -#ifndef ZEND_ENGINE_2 -#if HAVE_OVERLOAD - ,phpext_overload_ptr -#endif #endif #if HAVE_PCRE || HAVE_BUNDLED_PCRE ,phpext_pcre_ptr -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /win32 php4dllts.dsp
phanto Fri Jan 10 18:36:18 2003 EDT Modified files: /php4/win32 php4dllts.dsp Log: HEAD defaults to build with ZE2 now Index: php4/win32/php4dllts.dsp diff -u php4/win32/php4dllts.dsp:1.95 php4/win32/php4dllts.dsp:1.96 --- php4/win32/php4dllts.dsp:1.95 Sun Jan 5 10:58:29 2003 +++ php4/win32/php4dllts.dspFri Jan 10 18:36:18 2003 @@ -5,6 +5,7 @@ # TARGTYPE Win32 (x86) Dynamic-Link Library 0x0102 CFG=php4dllts - Win32 Debug_TS + !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE @@ -55,7 +56,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib /nologo /version:4.0 /dll /debug /machine:I386 /out:..\Debug_TS\php4ts_debug.dll /pdbtype:sept /libpath:..\TSRM\Debug_TS /libpath:..\Zend\Debug_TS /libpath:..\..\bindlib_w32\Debug /libpath:..\ext\mysql\libmysql\Debug_TS /libpath:Debug_TS /libpath:..\..\zlib\Debug +# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib +advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib +ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 +/dll /debug /machine:I386 /nodefaultlib:libcmt /out:..\Debug_TS\php4ts_debug.dll +/pdbtype:sept /libpath:..\TSRM\Debug_TS /libpath:..\Zend\Debug_TS +/libpath:..\..\bindlib_w32\Debug /libpath:..\ext\mysql\libmysql\Debug_TS +/libpath:Debug_TS /libpath:..\..\zlib\Debug !ELSEIF $(CFG) == php4dllts - Win32 Release_TS @@ -81,7 +82,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib /nologo /version:4.0 /dll /machine:I386 /out:..\Release_TS\php4ts.dll /libpath:..\TSRM\Release_TS /libpath:..\Zend\Release_TS /libpath:..\..\bindlib_w32\Release /libpath:..\ext\mysql\libmysql\Release_TS /libpath:Release_TS /libpath:..\..\zlib\Release +# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib +advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib +ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 +/dll /machine:I386 /nodefaultlib:libcmt /out:..\Release_TS\php4ts.dll +/libpath:..\TSRM\Release_TS /libpath:..\Zend\Release_TS +/libpath:..\..\bindlib_w32\Release /libpath:..\ext\mysql\libmysql\Release_TS +/libpath:Release_TS /libpath:..\..\zlib\Release !ELSEIF $(CFG) == php4dllts - Win32 Release_TS_inline @@ -108,7 +109,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:libc.lib /nodefaultlib:libcmt.lib /out:Release_TS/php4ts.dll /libpath:TSRM\Release_TS /libpath:Zend\Release_TS /libpath:..\bindlib_w32\Release -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib /nologo /version:4.0 /dll /machine:I386 /out:..\Release_TS_inline\php4ts.dll /libpath:..\TSRM\Release_TS_inline /libpath:..\Zend\Release_TS_inline /libpath:..\..\bindlib_w32\Release /libpath:..\ext\mysql\libmysql\Release_TS_inline /libpath:Release_TS_Inline /libpath:..\..\zlib\Release +# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib +advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib +ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib Urlmon.lib /nologo /version:4.0 +/dll /machine:I386 /nodefaultlib:libcmt /out:..\Release_TS_inline\php4ts.dll +/libpath:..\TSRM\Release_TS_inline /libpath:..\Zend\Release_TS_inline +/libpath:..\..\bindlib_w32\Release +/libpath:..\ext\mysql\libmysql\Release_TS_inline /libpath:Release_TS_Inline +/libpath:..\..\zlib\Release !ELSEIF $(CFG) == php4dllts - Win32 Release_TSDbg @@ -135,7 +136,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
[PHP-CVS] cvs: php4 /ext/com .cvsignore COM.c CREDITS TODO VARIANT.c com.h conversion.c conversion.h dispatch.c php_COM.h php_VARIANT.h variant.h
phanto Fri Jan 10 18:39:10 2003 EDT Removed files: /php4/ext/com .cvsignore COM.c com.h conversion.c conversion.h CREDITS dispatch.c php_COM.h php_VARIANT.h TODO VARIANT.c variant.h Log: ext/com is not compatible with ZE2, the ZE2 version is located in ext/rpc/com -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/overload .cvsignore CREDITS README config.m4 overload.c overload.dsp php_overload.h
phanto Fri Jan 10 18:40:13 2003 EDT Removed files: /php4/ext/overload .cvsignore config.m4 CREDITS overload.c overload.dsp php_overload.h README Log: this is now implemented by the engine itself -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP-CVS] cvs: php4(THREADED) /sapi/milter php_milter.c
forgot to cc the list. -Original Message- From: Harald Radi [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 12:19 PM To: 'Derick Rethans' Subject: RE: [PHP-CVS] cvs: php4(THREADED) /sapi/milter php_milter.c because i still didn't find the leak. HLP ;) valgrind tells me 0 lost blocks, but when running it standalone i can watch memory usage grewing by about 300k per request. if i comment out all php specific code (module_startup, request_startup co) all works fine, so it seems like request_shutdown isn't done correctly, on the other hand valgrind tells me, that it is done. harald -Original Message- From: Derick Rethans [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 10:33 AM To: Harald Radi Cc: [EMAIL PROTECTED] Subject: Re: [PHP-CVS] cvs: php4(THREADED) /sapi/milter php_milter.c On Sun, 8 Dec 2002, Harald Radi wrote: phantoSun Dec 8 14:04:38 2002 EDT Modified files: (Branch: THREADED) /php4/sapi/milter php_milter.c Log: threaded version to 1:1 map connections and php request handler threads Cool! But why is this in a different branch? Derick -- -- --- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -- --- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(THREADED) /sapi/milter php_milter.c
phanto Sun Dec 8 14:04:38 2002 EDT Modified files: (Branch: THREADED) /php4/sapi/milter php_milter.c Log: threaded version to 1:1 map connections and php request handler threads Index: php4/sapi/milter/php_milter.c diff -u php4/sapi/milter/php_milter.c:1.7 php4/sapi/milter/php_milter.c:1.7.2.1 --- php4/sapi/milter/php_milter.c:1.7 Sun Dec 1 15:28:54 2002 +++ php4/sapi/milter/php_milter.c Sun Dec 8 14:04:33 2002 @@ -25,7 +25,7 @@ #include zend_modules.h #ifndef ZTS -#error SRM sapi module is only useable in thread-safe mode +#error php-milter sapi module is only useable in thread-safe mode #endif #include SAPI.h @@ -61,33 +61,20 @@ #include zend_highlight.h #include zend_indent.h -#include libmilter/mfapi.h +#include php_milter.h #define OPTSTRING ac:d:Def:hnp:vVz:? -#define MG(v) TSRMG(milter_globals_id, zend_milter_globals *, v) #define IS_NONE %s(): This function must not be called outside of a milter callback functions scope #define NOT_EOM %s(): This function can only be used inside the milter_eom callbacks scope #define NOT_INIT %s(): This function can only be used inside the milter_init callbacks scope -#define MLFI_NONE 0 -#define MLFI_CONNECT 1 -#define MLFI_HELO 2 -#define MLFI_ENVFROM 3 -#define MLFI_ENVRCPT 4 -#define MLFI_HEADER5 -#define MLFI_EOH 6 -#define MLFI_BODY 7 -#define MLFI_EOM 8 -#define MLFI_ABORT 9 -#define MLFI_CLOSE 10 -#define MLFI_INIT 11 - /* {{{ globals */ extern char *ap_php_optarg; extern int ap_php_optind; +static pthread_attr_t detached_attr; static int flag_debug=0; static char *filename; @@ -95,7 +82,6 @@ ZEND_BEGIN_MODULE_GLOBALS(milter) SMFICTX *ctx; int state; - int initialized; ZEND_END_MODULE_GLOBALS(milter) ZEND_DECLARE_MODULE_GLOBALS(milter) @@ -133,7 +119,6 @@ /* call userland */ INIT_ZVAL(function_name); - ZVAL_STRING(function_name, milter_init, 0); /* set the milter context for possible use in API functions */ @@ -142,7 +127,6 @@ call_user_function(CG(function_table), NULL, function_name, retval, 0, NULL TSRMLS_CC); MG(state) = MLFI_NONE; - MG(initialized) = 1; if (Z_TYPE(retval) == IS_LONG) { ret = Z_LVAL(retval); @@ -154,17 +138,12 @@ } /* }}} */ -/* {{{ Milter callback functions - */ - -/* connection info filter, is called whenever sendmail connects to the milter */ -/* {{{ mlfi_connect() +/* {{{ PHP Milter handler */ -static sfsistatmlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) +static sfsistat php_milter_connect(char *hostname TSRMLS_DC) { zend_file_handle file_handle; - zval function_name, retval, *param[1]; - TSRMLS_FETCH(); + zval function_name, retval, host, *param[1]; /* request startup */ if (php_request_startup(TSRMLS_C)==FAILURE) { @@ -175,10 +154,6 @@ return SMFIS_TEMPFAIL; } - /* disable headers */ - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = filename; file_handle.free_filename = 0; @@ -188,323 +163,220 @@ /* call userland */ INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); + INIT_ZVAL(host); ZVAL_STRING(function_name, milter_connect, 0); - ZVAL_STRING(param[0], hostname, 1); + ZVAL_STRING(host, hostname, 1); - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_CONNECT; + param[0] = host; call_user_function(CG(function_table), NULL, function_name, retval, 1, param TSRMLS_CC); - MG(state) = MLFI_NONE; - + zval_dtor(host); + if (Z_TYPE(retval) == IS_LONG) { return Z_LVAL(retval); } return SMFIS_CONTINUE; } -/* }}} */ -/* SMTP HELO command filter */ -/* {{{ mlfi_helo() -*/ -static sfsistat mlfi_helo(SMFICTX *ctx, char *helohost) +static sfsistat php_milter_helo(char *helohost TSRMLS_DC) { - zval function_name, retval, *param[1]; - TSRMLS_FETCH(); + zval function_name, retval, helo, *param[1]; /* call userland */ INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); + INIT_ZVAL(helo); ZVAL_STRING(function_name, milter_helo, 0); - ZVAL_STRING(param[0], helohost, 1); + ZVAL_STRING(helo, helohost, 1); + + param[0] = helo; - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_HELO; - call_user_function(CG(function_table), NULL, function_name,
[PHP-CVS] cvs: php4(THREADED) /sapi/milter php_milter.c
phanto Sun Dec 8 14:38:28 2002 EDT Modified files: (Branch: THREADED) /php4/sapi/milter php_milter.c Log: MFH those punctuation fixes Index: php4/sapi/milter/php_milter.c diff -u php4/sapi/milter/php_milter.c:1.7.2.1 php4/sapi/milter/php_milter.c:1.7.2.2 --- php4/sapi/milter/php_milter.c:1.7.2.1 Sun Dec 8 14:04:33 2002 +++ php4/sapi/milter/php_milter.c Sun Dec 8 14:38:27 2002 @@ -65,9 +65,9 @@ #define OPTSTRING ac:d:Def:hnp:vVz:? -#define IS_NONE %s(): This function must not be called outside of a milter callback functions scope -#define NOT_EOM %s(): This function can only be used inside the milter_eom callbacks scope -#define NOT_INIT %s(): This function can only be used inside the milter_init callbacks scope +#define IS_NONE %s(): This function must not be called outside of a milter callback +function's scope +#define NOT_EOM %s(): This function can only be used inside the milter_eom +callback's scope +#define NOT_INIT %s(): This function can only be used inside the milter_init +callback's scope /* {{{ globals */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/milter milter.php
phanto Tue Dec 3 09:43:43 2002 EDT Modified files: /php4/sapi/milter milter.php Log: fix typos and make example more useful Index: php4/sapi/milter/milter.php diff -u php4/sapi/milter/milter.php:1.1 php4/sapi/milter/milter.php:1.2 --- php4/sapi/milter/milter.php:1.1 Sun Dec 1 15:29:14 2002 +++ php4/sapi/milter/milter.php Tue Dec 3 09:43:43 2002 @@ -21,8 +21,18 @@ * * see http://www.sendmail.com/partner/resources/development/milter_api/smfi_register.html#flags */ + +function milter_log($msg) +{ + $GLOBALS['log'] = fopen(/tmp/milter.log, a); + fwrite($GLOBALS['log'], date([H:i:s d.m.Y]) . \t{$msg}\n); + fclose($GLOBALS['log']); +} + function milter_init() { - smfi_setflags(SMFIF_ADDHDRS); + milter_log(-- startup --); + milter_log(milter_init()); + smfi_setflags(SMFIF_ADDHDRS); } /** @@ -30,6 +40,7 @@ */ function milter_connect($connect) { + milter_log(milter_connect('$connect')); } /** @@ -38,6 +49,7 @@ */ function milter_helo($helo) { + milter_log(milter_helo('$helo')); } /** @@ -46,6 +58,10 @@ */ function milter_envfrom($args) { + milter_log(milter_envfrom(args[])); + foreach ($args as $ix = $arg) { + milter_log(\targs[$ix] = $arg); + } } /** @@ -54,6 +70,10 @@ */ function milter_envrcpt($args) { + milter_log(milter_envrcpt(args[])); + foreach ($args as $ix = $arg) { + milter_log(\targs[$ix] = $arg); + } } /** @@ -62,6 +82,7 @@ */ function milter_header($header, $value) { + milter_log(milter_header('$header', '$value')); } /** @@ -69,13 +90,15 @@ */ function milter_eoh() { + milter_log(milter_eoh()); } /** * is called zero or more times between milter_eoh and milter_eom. */ -function mlfi_body($bodypart) +function milter_body($bodypart) { + milter_log(milter_body('$bodypart')); } /** @@ -85,6 +108,7 @@ */ function milter_eom() { + milter_log(milter_eom()); /* add PHP header to the message */ smfi_addheader(X-PHP, phpversion()); } @@ -93,14 +117,16 @@ * may be called at any time during message processing * (i.e. between some message-oriented routine and milter_eom). */ -function mlfi_abort() +function milter_abort() { + milter_log(milter_abort()); } /** * is always called once at the end of each connection. */ -function mlfi_close() +function milter_close() { + milter_log(milter_close()); } ? -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/milter TODO
phanto Tue Dec 3 11:26:57 2002 EDT Modified files: /php4/sapi/milter TODO Log: damn milter api: Furthermore, since there is not a one-to-one correspondence between threads and connections (N connections mapped onto M threads, M = N), connection-specific data must be accessed through the handles provided by the Milter library. which in other words means php_request_startup() and the corresponding php_request_shutdown() will never be called for the same thread Index: php4/sapi/milter/TODO diff -u php4/sapi/milter/TODO:1.4 php4/sapi/milter/TODO:1.5 --- php4/sapi/milter/TODO:1.4 Sun Dec 1 14:50:07 2002 +++ php4/sapi/milter/TODO Tue Dec 3 11:26:57 2002 @@ -1,3 +1,4 @@ +extensions aren't loaded stdout to syslog testing documentation -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/milter TODO
phanto Sun Dec 1 07:23:47 2002 EDT Modified files: /php4/sapi/milter TODO Log: no message Index: php4/sapi/milter/TODO diff -u php4/sapi/milter/TODO:1.2 php4/sapi/milter/TODO:1.3 --- php4/sapi/milter/TODO:1.2 Sat Nov 30 22:37:49 2002 +++ php4/sapi/milter/TODO Sun Dec 1 07:23:47 2002 @@ -1,3 +1,4 @@ +check context for milter api functions (only valid within callbacks) add ini setting for smfi_settimeout() set xxfi_flags via ini, SMFIF_CHGBODY can have a significant performance impact if set parse the file only once instead of per request -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/milter config.m4
phanto Sun Dec 1 08:36:54 2002 EDT Modified files: /php4/sapi/milter config.m4 Log: no message Index: php4/sapi/milter/config.m4 diff -u php4/sapi/milter/config.m4:1.3 php4/sapi/milter/config.m4:1.4 --- php4/sapi/milter/config.m4:1.3 Sun Dec 1 00:14:56 2002 +++ php4/sapi/milter/config.m4 Sun Dec 1 08:36:53 2002 @@ -1,12 +1,18 @@ dnl -dnl $Id: config.m4,v 1.3 2002/12/01 05:14:56 sniper Exp $ +dnl $Id: config.m4,v 1.4 2002/12/01 13:36:53 phanto Exp $ dnl AC_MSG_CHECKING(for Milter support) AC_ARG_WITH(milter, [ --with-milter=DIR Build PHP as Milter application],[ if test $withval = yes; then -MILTERPATH=/usr +if test -f /usr/lib/libmilter.a; then + MILTERPATH=/usr/lib +else if test -f /usr/lib/libmilter/libmilter.a; then + MILTERPATH=/usr/lib/libmilter +else + AC_MSG_ERROR(Unable to find libmilter.a) +fi else MILTERPATH=$withval fi @@ -17,7 +23,7 @@ PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/milter/Makefile.frag) PHP_SELECT_SAPI(milter, program, php_milter.c getopt.c,,'$(SAPI_MILTER_PATH)') - PHP_ADD_LIBRARY_WITH_PATH(milter, $MILTERPATH/lib,) + PHP_ADD_LIBRARY_WITH_PATH(milter, $MILTERPATH,) BUILD_MILTER=\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_MILTER_PATH) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/milter php_milter.c
phanto Sun Dec 1 11:37:59 2002 EDT Modified files: /php4/sapi/milter php_milter.c Log: first working version Index: php4/sapi/milter/php_milter.c diff -u php4/sapi/milter/php_milter.c:1.4 php4/sapi/milter/php_milter.c:1.5 --- php4/sapi/milter/php_milter.c:1.4 Sat Nov 30 22:37:49 2002 +++ php4/sapi/milter/php_milter.c Sun Dec 1 11:37:59 2002 @@ -73,7 +73,7 @@ * globals */ static int flag_debug=0; -static zend_file_handle file_handle; +static char *filename; /* per thread */ ZEND_BEGIN_MODULE_GLOBALS(milter) @@ -89,7 +89,8 @@ /* connection info filter */ static sfsistatmlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) { - zval *function_name, *retval, *param[1]; + zend_file_handle file_handle; + zval function_name, retval, *param[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ @@ -106,19 +107,26 @@ SG(headers_sent) = 1; SG(request_info).no_headers = 1; - php_execute_script(file_handle TSRMLS_CC); + file_handle.type = ZEND_HANDLE_FILENAME; + file_handle.filename = filename; + file_handle.free_filename = 0; + file_handle.opened_path = NULL; + php_execute_script(file_handle TSRMLS_CC); + /* call userland */ - INIT_PZVAL(function_name); + INIT_ZVAL(function_name); + + ALLOC_ZVAL(param[0]); INIT_PZVAL(param[0]); - ZVAL_STRING(function_name, milter_connect, 1); + ZVAL_STRING(function_name, milter_connect, 0); ZVAL_STRING(param[0], hostname, 1); - call_user_function(CG(function_table), NULL, function_name, retval, 1, param TSRMLS_CC); + call_user_function(CG(function_table), NULL, function_name, retval, 1, param +TSRMLS_CC); - if (Z_TYPE_P(retval) == IS_LONG) { - return Z_LVAL_P(retval); + if (Z_TYPE(retval) == IS_LONG) { + return Z_LVAL(retval); } else { return SMFIS_CONTINUE; } @@ -127,23 +135,27 @@ /* SMTP HELO command filter */ static sfsistat mlfi_helo(SMFICTX *ctx, char *helohost) { - zval *function_name, *retval, *param[1]; + zval function_name, retval, *param[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ MG(ctx) = ctx; /* call userland */ - INIT_PZVAL(function_name); + INIT_ZVAL(function_name); + + ALLOC_ZVAL(param[0]); INIT_PZVAL(param[0]); - ZVAL_STRING(function_name, milter_helo, 1); + ZVAL_STRING(function_name, milter_helo, 0); ZVAL_STRING(param[0], helohost, 1); - call_user_function(CG(function_table), NULL, function_name, retval, 1, param TSRMLS_CC); + call_user_function(CG(function_table), NULL, function_name, retval, 1, param +TSRMLS_CC); + + FREE_ZVAL(param[0]); - if (Z_TYPE_P(retval) == IS_LONG) { - return Z_LVAL_P(retval); + if (Z_TYPE(retval) == IS_LONG) { + return Z_LVAL(retval); } else { return SMFIS_CONTINUE; } @@ -152,17 +164,19 @@ /* envelope sender filter */ static sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv) { - zval *function_name, *retval, *param[1]; + zval function_name, retval, *param[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ MG(ctx) = ctx; /* call userland */ - INIT_PZVAL(function_name); + INIT_ZVAL(function_name); + + ALLOC_ZVAL(param[0]); INIT_PZVAL(param[0]); - ZVAL_STRING(function_name, milter_envelope_from, 1); + ZVAL_STRING(function_name, milter_envelope_from, 0); array_init(param[0]); while (*argv) { @@ -170,10 +184,12 @@ argv++; } - call_user_function(CG(function_table), NULL, function_name, retval, 1, param TSRMLS_CC); + call_user_function(CG(function_table), NULL, function_name, retval, 1, param +TSRMLS_CC); - if (Z_TYPE_P(retval) == IS_LONG) { - return Z_LVAL_P(retval); + FREE_ZVAL(param[0]); + + if (Z_TYPE(retval) == IS_LONG) { + return Z_LVAL(retval); } else { return SMFIS_CONTINUE; } @@ -182,17 +198,19 @@ /* envelope recipient filter */ static sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv) { - zval *function_name, *retval, *param[1]; + zval function_name, retval, *param[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ MG(ctx) = ctx; /* call userland */ - INIT_PZVAL(function_name); + INIT_ZVAL(function_name); + + ALLOC_ZVAL(param[0]); INIT_PZVAL(param[0]); - ZVAL_STRING(function_name, milter_envelope_recipient, 1); +
[PHP-CVS] cvs: php4 /sapi/milter php_milter.c
phanto Sat Nov 30 20:17:42 2002 EDT Modified files: /php4/sapi/milter php_milter.c Log: added remaining functions, still untested, still having problems with config.m4 Index: php4/sapi/milter/php_milter.c diff -u php4/sapi/milter/php_milter.c:1.1 php4/sapi/milter/php_milter.c:1.2 --- php4/sapi/milter/php_milter.c:1.1 Sat Nov 30 19:21:10 2002 +++ php4/sapi/milter/php_milter.c Sat Nov 30 20:17:42 2002 @@ -139,7 +139,7 @@ params[0] = host; - call_user_function(CG(function_table), NULL, function_name, retval, 1, param TSRMLS_CC); + call_user_function(CG(function_table), NULL, function_name, retval, 1, params +TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { return Z_LONG_P(retval); @@ -151,7 +151,7 @@ /* envelope sender filter */ static sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv) { - zval *function_name, *retval; + zval *function_name, *retval, *v, **params[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ @@ -159,8 +159,19 @@ /* call userland */ ZVAL_INIT(function_name); + ZVAL_INIT(v); + ZVAL_STRING(function_name, milter_envelope_from, 1); - call_user_function(CG(function_table), NULL, function_name, retval, 0, NULL TSRMLS_CC); + array_init(v); + + while (*argv) { + add_next_index_string(v, *argv, 1); + argv++; + } + + params[0] = v; + + call_user_function(CG(function_table), NULL, function_name, retval, 1, params +TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { return Z_LONG_P(retval); @@ -172,7 +183,7 @@ /* envelope recipient filter */ static sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv) { - zval *function_name, *retval; + zval *function_name, *retval, *v, **params[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ @@ -180,8 +191,19 @@ /* call userland */ ZVAL_INIT(function_name); + ZVAL_INIT(v); + ZVAL_STRING(function_name, milter_envelope_recipient, 1); - call_user_function(CG(function_table), NULL, function_name, retval, 0, NULL TSRMLS_CC); + array_init(v); + + while (*argv) { + add_next_index_string(v, *argv, 1); + argv++; + } + + params[0] = v; + + call_user_function(CG(function_table), NULL, function_name, retval, 1, params +TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { return Z_LONG_P(retval); @@ -193,7 +215,7 @@ /* header filter */ static sfsistat mlfi_header(SMFICTX *ctx, char *headerf, char *headerv) { - zval *function_name, *retval; + zval *function_name, *retval, *f, *v, **params[2]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ @@ -201,8 +223,17 @@ /* call userland */ ZVAL_INIT(function_name); + ZVAL_INIT(f); + ZVAL_INIT(v); + ZVAL_STRING(function_name, milter_header, 1); - call_user_function(CG(function_table), NULL, function_name, retval, 0, NULL TSRMLS_CC); + ZVAL_STRING(f, headerf, 1); + ZVAL_STRING(v, headerv, 1); + + params[0] = f; + params[1] = v; + + call_user_function(CG(function_table), NULL, function_name, retval, 2, params +TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { return Z_LONG_P(retval); @@ -235,7 +266,7 @@ /* body block */ static sfsistat mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t len) { - zval *function_name, *retval; + zval *function_name, *retval, *p, **params[1];; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ @@ -243,7 +274,13 @@ /* call userland */ ZVAL_INIT(function_name); + ZVAL_INIT(p); + ZVAL_STRING(function_name, milter_body, 1); + ZVAL_STRINGL(p, bodyp, len, 1); + + params[0] = p; + call_user_function(CG(function_table), NULL, function_name, retval, 0, NULL TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { @@ -342,37 +379,101 @@ */ PHP_FUNCTION(smfi_getsymval) { - // smfi_getsymval(); + char *symname, *ret; + int len; + +if (zend_parse_parameters(1 TSRMLS_CC, s, symname, len) == SUCCESS) { + if ((ret = smfi_getsymval(MG(ctx), symname)) != NULL) { + RETVAL_STRING(ret); + } + } + + RETVAL_NULL(); } PHP_FUNCTION(smfi_setreply) { - // smfi_setreply(); + char *rcode, *xcode, *message; + int len; + + if (zend_parse_parameters(3 TSRMLS_CC, sss, rcode, len, xcode, len, +message, len) == SUCCESS) { + if (smfi_setreply(MG(ctx), rcode, xcode, message) == MI_SUCCESS) { +
[PHP-CVS] cvs: php4 /sapi/milter EXPERIMENTAL
phanto Sat Nov 30 20:18:49 2002 EDT Added files: /php4/sapi/milter EXPERIMENTAL Log: added remaining functions, still untested, still having problems with config.m4 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/milter TODO
phanto Sat Nov 30 20:36:26 2002 EDT Added files: /php4/sapi/milter TODO Log: todo or not todo -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/milter php_milter.c
phanto Sat Nov 30 21:45:30 2002 EDT Modified files: /php4/sapi/milter php_milter.c Log: fix build Index: php4/sapi/milter/php_milter.c diff -u php4/sapi/milter/php_milter.c:1.2 php4/sapi/milter/php_milter.c:1.3 --- php4/sapi/milter/php_milter.c:1.2 Sat Nov 30 20:17:42 2002 +++ php4/sapi/milter/php_milter.c Sat Nov 30 21:45:30 2002 @@ -24,6 +24,10 @@ #include php_variables.h #include zend_modules.h +#ifndef ZTS +#error SRM sapi module is only useable in thread-safe mode +#endif + #include SAPI.h #include stdio.h @@ -60,7 +64,7 @@ #include libmilter/mfapi.h #define OPTSTRING ac:d:Def:hnp:vVz:? -#define MG(v) TSRMG(milter_globals_id, milter_globals *, v) +#define MG(v) TSRMG(milter_globals_id, zend_milter_globals *, v) extern char *ap_php_optarg; extern int ap_php_optind; @@ -68,14 +72,15 @@ /* * globals */ -static int milter_globals_id; static int flag_debug=0; static zend_file_handle file_handle; /* per thread */ -typedef struct _milter_globals { +ZEND_BEGIN_MODULE_GLOBALS(milter) SMFICTX *ctx; -} milter_globals; +ZEND_END_MODULE_GLOBALS(milter) + +ZEND_DECLARE_MODULE_GLOBALS(milter) /* * Milter callbacks @@ -84,7 +89,7 @@ /* connection info filter */ static sfsistatmlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) { - zval *function_name, *retval, *host, **params[1]; + zval *function_name, *retval, *param[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ @@ -105,14 +110,12 @@ /* call userland */ ZVAL_INIT(function_name); - ZVAL_INIT(host); + ZVAL_INIT(param[0]); ZVAL_STRING(function_name, milter_connect, 1); - ZVAL_STRING(host, hostname, 1); - - params[0] = host; + ZVAL_STRING(param[0], hostname, 1); - call_user_function(CG(function_table), NULL, function_name, retval, 1, params TSRMLS_CC); + call_user_function(CG(function_table), NULL, function_name, retval, 1, param +TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { return Z_LONG_P(retval); @@ -124,7 +127,7 @@ /* SMTP HELO command filter */ static sfsistat mlfi_helo(SMFICTX *ctx, char *helohost) { - zval *function_name, *retval, *host, **params[1]; + zval *function_name, *retval, *param[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ @@ -132,14 +135,12 @@ /* call userland */ ZVAL_INIT(function_name); - ZVAL_INIT(host); + ZVAL_INIT(param[0]); ZVAL_STRING(function_name, milter_helo, 1); - ZVAL_STRING(host, helohost, 1); + ZVAL_STRING(param[0], helohost, 1); - params[0] = host; - - call_user_function(CG(function_table), NULL, function_name, retval, 1, params TSRMLS_CC); + call_user_function(CG(function_table), NULL, function_name, retval, 1, param +TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { return Z_LONG_P(retval); @@ -151,7 +152,7 @@ /* envelope sender filter */ static sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv) { - zval *function_name, *retval, *v, **params[1]; + zval *function_name, *retval, *param[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ @@ -159,19 +160,17 @@ /* call userland */ ZVAL_INIT(function_name); - ZVAL_INIT(v); + ZVAL_INIT(param[0]); ZVAL_STRING(function_name, milter_envelope_from, 1); - array_init(v); + array_init(param[0]); while (*argv) { - add_next_index_string(v, *argv, 1); + add_next_index_string(param[0], *argv, 1); argv++; } - params[0] = v; - - call_user_function(CG(function_table), NULL, function_name, retval, 1, params TSRMLS_CC); + call_user_function(CG(function_table), NULL, function_name, retval, 1, param +TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { return Z_LONG_P(retval); @@ -183,7 +182,7 @@ /* envelope recipient filter */ static sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv) { - zval *function_name, *retval, *v, **params[1]; + zval *function_name, *retval, *param[1]; TSRMLS_FETCH(); /* set the milter context for possible use in API functions */ @@ -191,19 +190,17 @@ /* call userland */ ZVAL_INIT(function_name); - ZVAL_INIT(v); + ZVAL_INIT(param[0]); ZVAL_STRING(function_name, milter_envelope_recipient, 1); - array_init(v); + array_init(param[0]); while (*argv) { - add_next_index_string(v, *argv, 1); + add_next_index_string(param[0], *argv, 1); argv++; } - params[0] = v; - - call_user_function(CG(function_table),
[PHP-CVS] cvs: php4 /sapi/milter Makefile.frag TODO config.m4 getopt.c php_milter.c
phanto Sat Nov 30 22:37:50 2002 EDT Added files: /php4/sapi/milter getopt.c Modified files: /php4/sapi/milter config.m4 Makefile.frag php_milter.c TODO Log: it finally compiles now tests will follow tomorrow Index: php4/sapi/milter/config.m4 diff -u php4/sapi/milter/config.m4:1.1 php4/sapi/milter/config.m4:1.2 --- php4/sapi/milter/config.m4:1.1 Sat Nov 30 19:21:10 2002 +++ php4/sapi/milter/config.m4 Sat Nov 30 22:37:49 2002 @@ -1,39 +1,32 @@ dnl -dnl $Id: config.m4,v 1.1 2002/12/01 00:21:10 phanto Exp $ +dnl $Id: config.m4,v 1.2 2002/12/01 03:37:49 phanto Exp $ dnl -AC_MSG_CHECKING(for milter support) +AC_MSG_CHECKING(for Milter support) AC_ARG_WITH(milter, -[ --with-milter=DIR Build PHP as a Milter for use with Sendmail.],[ - PHP_MILTER=$withval -],[ - PHP_MILTER=no -]) -AC_MSG_RESULT($PHP_MILTER) - -if test $PHP_MILTER != no; then - PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/milter/Makefile.frag) - PHP_BUILD_THREAD_SAFE +[ --with-milter=DIR Build PHP as Milter application],[ + if test $withval = yes; then +MILTERPATH=/usr + else +MILTERPATH=$withval + fi + SAPI_MILTER_PATH=sapi/milter/php-milter PHP_SUBST(SAPI_MILTER_PATH) - - PHP_SELECT_SAPI(php-milter, program, php_milter.c,,'$(SAPI_MILTER_PATH)') + PHP_BUILD_THREAD_SAFE + PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/milter/Makefile.frag) - case $host_alias in -*darwin*) - BUILD_MILTER=\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_MILTER_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_MILTER_PATH) -;; -*) - BUILD_MILTER=\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_MILTER_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_MILTER_PATH) -;; - esac - INSTALL_MILTER=\$(INSTALL) -m 0755 \$(SAPI_MILTER_PATH) \$(INSTALL_ROOT)\$(bindir)/php-milter - PHP_SUBST(BUILD_MILTER) - PHP_SUBST(INSTALL_MILTER) -else - PHP_DISABLE_MILTER -fi + PHP_SELECT_SAPI(milter, program, php_milter.c getopt.c,,'$(SAPI_MILTER_PATH)') + PHP_ADD_LIBRARY_WITH_PATH(milter, $MILTERPATH/lib,) + + BUILD_MILTER=\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) +\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) +\$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_MILTER_PATH) -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: + INSTALL_IT=\$(INSTALL) -m 0755 \$(SAPI_MILTER_PATH) \$(bindir)/php-milter + RESULT=yes + PHP_SUBST(BUILD_MILTER) + PHP_SUBST(FASTCGI_LIBADD) + PHP_SUBST(EXT_PROGRAM_LDADD) +],[ + RESULT=no +]) +AC_MSG_RESULT($RES \ No newline at end of file Index: php4/sapi/milter/Makefile.frag diff -u php4/sapi/milter/Makefile.frag:1.1 php4/sapi/milter/Makefile.frag:1.2 --- php4/sapi/milter/Makefile.frag:1.1 Sat Nov 30 19:21:10 2002 +++ php4/sapi/milter/Makefile.frag Sat Nov 30 22:37:49 2002 @@ -1,7 +1,2 @@ -$(SAPI_MILTER_PATH): $(PHP_GLOBAL_OBJS) $(PHP_MILTER_OBJS) +$(SAPI_MILTER_PATH): $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(BUILD_MILTER) - -install-milter: $(SAPI_MILTER_PATH) - @echo Installing PHP Milter binary:$(INSTALL_ROOT)$(bindir)/ - @$(INSTALL_CLI) - Index: php4/sapi/milter/php_milter.c diff -u php4/sapi/milter/php_milter.c:1.3 php4/sapi/milter/php_milter.c:1.4 --- php4/sapi/milter/php_milter.c:1.3 Sat Nov 30 21:45:30 2002 +++ php4/sapi/milter/php_milter.c Sat Nov 30 22:37:49 2002 @@ -109,8 +109,8 @@ php_execute_script(file_handle TSRMLS_CC); /* call userland */ - ZVAL_INIT(function_name); - ZVAL_INIT(param[0]); + INIT_PZVAL(function_name); + INIT_PZVAL(param[0]); ZVAL_STRING(function_name, milter_connect, 1); ZVAL_STRING(param[0], hostname, 1); @@ -118,7 +118,7 @@ call_user_function(CG(function_table), NULL, function_name, retval, 1, param TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { - return Z_LONG_P(retval); + return Z_LVAL_P(retval); } else { return SMFIS_CONTINUE; } @@ -134,8 +134,8 @@ MG(ctx) = ctx; /* call userland */ - ZVAL_INIT(function_name); - ZVAL_INIT(param[0]); + INIT_PZVAL(function_name); + INIT_PZVAL(param[0]); ZVAL_STRING(function_name, milter_helo, 1); ZVAL_STRING(param[0], helohost, 1); @@ -143,7 +143,7 @@ call_user_function(CG(function_table), NULL, function_name, retval, 1, param TSRMLS_CC); if (Z_TYPE_P(retval) == IS_LONG) { - return Z_LONG_P(retval); + return Z_LVAL_P(retval); } else { return SMFIS_CONTINUE; } @@ -159,8 +159,8 @@ MG(ctx) = ctx; /*
[PHP-CVS] cvs: php4 / NEWS
phanto Fri Oct 18 04:18:11 2002 EDT Modified files: /php4 NEWS Log: make jani happy Index: php4/NEWS diff -u php4/NEWS:1.1216 php4/NEWS:1.1217 --- php4/NEWS:1.1216Fri Oct 18 03:56:01 2002 +++ php4/NEWS Fri Oct 18 04:18:11 2002 -11,6 +11,8 . ext/icap . sapi/fhttpd - Moved ext/vpopmail to PECL. (James) +- Fixed bugs #19156 and #19544 (COM extension leaks memory and keeps + components referenced). (Harald) - Added fribidi_get_charsets() and fribidi_charset_info() functions. (Tal) - Added Oracle TIMESTAMP type to oci8 extension. (Thies) - Fixed fgets($fp) to read until EOL when length parameter is not set. (Wez) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/com VARIANT.c conversion.c conversion.h
phanto Wed Oct 16 19:56:33 2002 EDT Modified files: /php4/ext/com conversion.c conversion.h VARIANT.c Log: changed the VARIANT class to be able to create arrays of all types and not only VT_VARIANT Index: php4/ext/com/conversion.c diff -u php4/ext/com/conversion.c:1.49 php4/ext/com/conversion.c:1.50 --- php4/ext/com/conversion.c:1.49 Thu May 30 19:07:21 2002 +++ php4/ext/com/conversion.c Wed Oct 16 19:56:33 2002 -42,7 +42,7 /* implementations */ PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage TSRMLS_DC) { - int type = VT_EMPTY;/* default variant type */ + VARTYPE type = VT_EMPTY;/* default variant type */ switch (Z_TYPE_P(pval_arg)) { case IS_NULL: -90,11 +90,11 PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type, int codepage TSRMLS_DC) { - php_pval_to_variant_ex2(pval_arg, var_arg, Z_LVAL_P(pval_type), codepage TSRMLS_CC); + php_pval_to_variant_ex2(pval_arg, var_arg, (unsigned short) +Z_LVAL_P(pval_type), codepage TSRMLS_CC); } -PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type, int codepage TSRMLS_DC) +PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, VARTYPE type, +int codepage TSRMLS_DC) { OLECHAR *unicode_str; -108,7 +108,7 int numberOfElements = zend_hash_num_elements(ht); SAFEARRAY *safeArray; SAFEARRAYBOUND bounds[1]; - VARIANT *v; + VARIANT *v, var; zval **entry;/* An entry in the input array */ type = ~VT_ARRAY; -118,29 +118,35 ALLOC_VARIANT(V_VARIANTREF(var_arg)); var_arg = V_VARIANTREF(var_arg);/* put the array in that VARIANT */ } + if (!type) { + // if no type is given we take the variant type + type = VT_VARIANT; + } bounds[0].lLbound = 0; bounds[0].cElements = numberOfElements; - safeArray = SafeArrayCreate(VT_VARIANT, 1, bounds); + safeArray = SafeArrayCreate(type, 1, bounds); if (NULL == safeArray) { php_error( E_WARNING,Unable to convert php array to VARIANT array - %s, numberOfElements ? : (Empty input array)); ZVAL_FALSE(pval_arg); } else { V_ARRAY(var_arg) = safeArray; - V_VT(var_arg) = VT_ARRAY|VT_VARIANT;/* Now have a valid safe array allocated */ + V_VT(var_arg) = VT_ARRAY|type;/* Now have a +valid safe array allocated */ if (SUCCEEDED(SafeArrayLock(safeArray))) { ulong i; + UINT size = SafeArrayGetElemsize(safeArray); zend_hash_internal_pointer_reset(ht); for (i = 0; i (ulong)numberOfElements; ++i) { if ((zend_hash_get_current_data(ht, (void **)entry) == SUCCESS) (entry != NULL)) { /* Get a pointer to the php array element */ /* Add another value to the safe array */ - if (SUCCEEDED(SafeArrayPtrOfIndex( safeArray, i, v))) { /* Pointer to output element entry retrieved successfully */ - if (type) { /* explicit type */ - php_pval_to_variant_ex2(*entry, v, type, codepage TSRMLS_CC);/* Do the required conversion */ + if +(SUCCEEDED(SafeArrayPtrOfIndex(safeArray, i, v))) {/* +Pointer to output element entry retrieved successfully */ + if (type == VT_VARIANT) { + +php_pval_to_variant(*entry, v, codepage TSRMLS_CC); /* Do +the required conversion */ } else { - php_pval_to_variant(*entry, v, codepage TSRMLS_CC);/* Do the required conversion */ + +php_pval_to_variant_ex2(*entry, var, type, codepage TSRMLS_CC);/* Do the +required conversion */ + memcpy(v, +(var.byref), size); }