[PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/mbstring mbfilter.c mbfilter.h mbregex.cmbstring.c mbstring.h /main rfc1867.c
Marcus, Don't forget to create patch against development version :) cvs.php.net is _NOT_ for development new encoding/feature. http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/php-i18n/ -- Yasuo Ohgaki -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
Ok, had a play with this updated copy on http://docs.akbkhome.com/threads.tgz added a few of pthreads calls to TSRM.c did most of the testing without this abstraction layer - just to see if I could get it to work. used php_exectute_script, rather than getting clever and copying the function/class hashtables. results: It worked (with a few caveats - that are just a matter of getting to know threading better)... some of the issues: -if the child thread finishes before the main one - then the main one needs to wait somehow.. ** FIX = probably need to keep a count of threads that are running and block at MSHUTDOWN on the main thread if stuff is still going. -the child thread needs to have the modules functions loaded before it starts running really - otherwise you get intermitant 'functions not available' if you dont dl() the module in the child thread. ** FIX = I need to look at the pthreads equivalant for tsrm_wait_event(thread.start_event,TSRM_INFINITE); will be.. this should make sure that the main thread doesnt do anything while the main thread is starting up.. - php_request_shutdown(NULL); calls the MSHUTDOWN for all modules - a good example of where this cause trouble is the ext/standard/string.c MSHUTDOWN, which has a static mutex that is freed. (and would be freed twice when the main thread finishes) - hence php_request_shutdown(), probably doesnt want to be called on a thread completion.. ** FIX = not sure? - does this need fixing or should we just ignore php_request_shutdown.. due to the nature of thread scheduling, you dont get anything like '1 opcode from thread A, 1 opcode from thread B', more like about 30-40 opcodes randomly from each thread.. regards alan Shane Caraveo wrote: Here is a *very* rough peice of code for starting a thread. It should get across the idea of how I am thinking threads need to be started, but it doesn't work (I haven't even tried to run it). More importantly though, as a starter, is getting an api into TSRM that will support the abstraction of any thread calls. I'm not realy concerned with shared variables at this point, since I think there is a chunk of work to do in just getting threads to work. I'm not mailing this onto the list, since I'm sure not too many people want to get attachments. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] sigs for php sources
Hi Are there any plans to provide any kind of verification for the tar-balls from php.net (md5, gpg, whatever)? Due to the latest incidents (openssh et al..) more people are aware of the fact, that changed sources could be a problem. I know, you're talking about providing this stuff to pear, but what about the actual php-sources? It shouldn't be a problem to add some md5 stuff to each tarball (for the time being). At least one could then be sure, that the mirrors (where we all download our sources ;) ) didn't compromise it (if I download the md5 sig from another server...). Using GPG (or openssl as discussed some days ago) would provide more security than just md5, but maybe we should waiting for the verifying pear-installer for doing that. chregu -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
At 04:29 PM 8/3/2002 +0800, Alan Knowles wrote: Ok, had a play with this updated copy on http://docs.akbkhome.com/threads.tgz added a few of pthreads calls to TSRM.c did most of the testing without this abstraction layer - just to see if I could get it to work. used php_exectute_script, rather than getting clever and copying the function/class hashtables. This was exactly what I suggested a few minutes ago :) results: It worked (with a few caveats - that are just a matter of getting to know threading better)... some of the issues: -if the child thread finishes before the main one - then the main one needs to wait somehow.. ** FIX = probably need to keep a count of threads that are running and block at MSHUTDOWN on the main thread if stuff is still going. -the child thread needs to have the modules functions loaded before it starts running really - otherwise you get intermitant 'functions not available' if you dont dl() the module in the child thread. ** FIX = I need to look at the pthreads equivalant for tsrm_wait_event(thread.start_event,TSRM_INFINITE); will be.. this should make sure that the main thread doesnt do anything while the main thread is starting up.. You should probably make threads a PHP resource and the destructor would wait for the thread to finish. - php_request_shutdown(NULL); calls the MSHUTDOWN for all modules - a good example of where this cause trouble is the ext/standard/string.c MSHUTDOWN, which has a static mutex that is freed. (and would be freed twice when the main thread finishes) - hence php_request_shutdown(), probably doesnt want to be called on a thread completion.. ** FIX = not sure? - does this need fixing or should we just ignore php_request_shutdown.. I think threads should be treated exactly like a separate request so I think most code could run as is. due to the nature of thread scheduling, you dont get anything like '1 opcode from thread A, 1 opcode from thread B', more like about 30-40 opcodes randomly from each thread.. That's fine. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
By the way, if we do end up making this kind of thing mainstream we should probably use APR (or another library) for thread abstraction. I wouldn't want to do all of that work over. Andi At 04:29 PM 8/3/2002 +0800, Alan Knowles wrote: Ok, had a play with this updated copy on http://docs.akbkhome.com/threads.tgz added a few of pthreads calls to TSRM.c did most of the testing without this abstraction layer - just to see if I could get it to work. used php_exectute_script, rather than getting clever and copying the function/class hashtables. results: It worked (with a few caveats - that are just a matter of getting to know threading better)... some of the issues: -if the child thread finishes before the main one - then the main one needs to wait somehow.. ** FIX = probably need to keep a count of threads that are running and block at MSHUTDOWN on the main thread if stuff is still going. -the child thread needs to have the modules functions loaded before it starts running really - otherwise you get intermitant 'functions not available' if you dont dl() the module in the child thread. ** FIX = I need to look at the pthreads equivalant for tsrm_wait_event(thread.start_event,TSRM_INFINITE); will be.. this should make sure that the main thread doesnt do anything while the main thread is starting up.. - php_request_shutdown(NULL); calls the MSHUTDOWN for all modules - a good example of where this cause trouble is the ext/standard/string.c MSHUTDOWN, which has a static mutex that is freed. (and would be freed twice when the main thread finishes) - hence php_request_shutdown(), probably doesnt want to be called on a thread completion.. ** FIX = not sure? - does this need fixing or should we just ignore php_request_shutdown.. due to the nature of thread scheduling, you dont get anything like '1 opcode from thread A, 1 opcode from thread B', more like about 30-40 opcodes randomly from each thread.. regards alan Shane Caraveo wrote: Here is a *very* rough peice of code for starting a thread. It should get across the idea of how I am thinking threads need to be started, but it doesn't work (I haven't even tried to run it). More importantly though, as a starter, is getting an api into TSRM that will support the abstraction of any thread calls. I'm not realy concerned with shared variables at this point, since I think there is a chunk of work to do in just getting threads to work. I'm not mailing this onto the list, since I'm sure not too many people want to get attachments. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_execute.c zend_language_parser.y zend_language_scanner.l zend_operators.c zend_operators.h
At 02:43 AM 7/30/2002 -0400, Andrei Zmievski wrote: On Tue, 30 Jul 2002, Andi Gutmans wrote: Hey, Can't you share the patch before you just go ahead and just commit it? I still have the same issue I used to have. Hey, the patch has been available for a long while now. :-) I think using the cast operators for the types is pretty ugly. The code looks something like: $foo is (int) I we should only support classes and not support basic types? We have the non-OOP function for those. This is really an OOP operator. Don't you think we should have a unified way of testing for variable's type/class? I understand that we don't have type unification yet, but having a separate function for each basic type is kind of ugly too. I'd prefer is to be an OOP only construct. i.e. for anything other than an object it'd return false. Just some food for though before we finalize this. This operator will be a reserved word. Are we sure we want is to be a reserved word? It might be used quite a bit. BTW: I think it's a good idea to not declare is_type_expr in the parser but to use catch_or_import_class_entry and change its name to something which fits both. I don't like declaring the same rules more than once if I can help it. This rule will probably also be useful for future things. Yeah, I think it's a good idea too. Should we call it class_entry_ref or something like that? OK by me. I can't think of a very sexy name myself. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
At 05:43 PM 8/1/2002 +0800, Alan Knowles wrote: It's not about looking at the perl code, that will tell you nothing unless you know perl internals. It's about the way the interpreter works, some of the architecture, that is simular to PHP. In PHP, threads are isolated, kind of like seperate processes, but in threads. From my understanding they are 'forced to be isolated' by the TSRM stuff. which looks like it stores globals in something like an associated array ( thread id = global c variable - eg. compiler_globals etc.), when ZTS is enabled.. Everything in PHP works that way, so in creating threads for php scripts, you have to have a seperate interpreter. Then you have to create a bridge between the threads for shared variables. shmop comes close to what is needed, but not close enough. the real use of the threading I guess is for people who want to write tcp servers, or desktop gtk apps. Thoughts on accessing 'threaded shared vars' $_THREADVAR['gtktext'] type.. php_threads_malloc_lock(); $_THREADVAR['gtktext']-add_text('some data ouput'); php_threads_malloc_unlock(); this would I guess involve rather heavy changes to the ZE engine to recogize an lock/unlock, copy (rather than refcount) etc. variables that where threaded.. Threaded objects??? I guess the other consideration is to have thread variable objects.. $threadvar = new Thread_Var(); $threadvar-setNewObject('mywidget','GtkWindow'); $threadvar-set('mywidget',$gtkobject); $var = $threadvar-get('mywidget'); $var = $threadvar-getArray('key','val'); $threadvar-callMethod('mywidget', 'add_text','something'); obviously copying and accessing these would probably be easier to cope with ( without having to modify heavily the zend engine) - we could do 'real' copying on the data, rather than refcounting them. and reduce the headaches... You're much closer to what needs to happen now. But you cannot simply point to the memory for another thread. Doing that will cause problems like you are running into. You actually have to copy a bunch of stuff so each thread is completely independent. Do you mean we will have to really physically copy the all theopcode data from one thread to another? I've worked up some code in TSRM to abstract native thread calls, and have started on an extension, but probably won't have it complete until this weekend some time. What you've done now is fairly simular, but pthread specific. Given time, I might have enough done to email a diff containing my work tomorrow night if you want to take a look. Anything I can do to help - testing, understanding - let me know. Sounds Great. First of all I agree that the two threads shouldn't really share the same engine instance. It would mean that everything would have to be mutexed. The solution of creating a separate interpreter instance and having a couple of methods to share data in between them (like shared memory) is the way to go. As creating a copy of a currently executing instance is very hard to do in my opinion I suggest an API such as: create_thread(thread.php); This would create a new instance of the interpreter which would compile thread.php and start running it. So the actual function/class tables of the thread could be different from the parent who created it which I think is fine. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] HANDLE_BLOCK_INTERRUPTIONS
Theoretically these should be used when the engine is not in a stable state (i.e. would crash on shutdown). As this can also include PHP's code and PHP extensions I'm not really sure how much this really helps. Andi At 08:04 AM 8/2/2002 -0700, Brad LaFountain wrote: Thanks.. I figured it out after looking at all the places where it was being used. The biggest use was when you are changing link'd lists or arrays. So i assumed it did something to that affect. - brad --- Thies C. Arntzen [EMAIL PROTECTED] wrote: On Thu, Aug 01, 2002 at 10:10:10AM -0700, Brad LaFountain wrote: HANDLE_BLOCK_INTERRUPTIONS(); HANDLE_UNBLOCK_INTERRUPTIONS(); what exactly does these do? this is an apache thingie. you can tell apache that you don't want to be killed during certain operations. i doubt very mucht that it really helps;-) look in the apache sapi module. tc __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Weird?!?!
I think this is a good question. I'm not quite sure that casting dval to long is the same as multiplying the two longs. Anyone know the answer? Andi At 02:28 PM 7/31/2002 +0200, Stefan Esser wrote: Hi, Could someone tell me why the Zend Engine calculates every multiplication 2 times??? zend_operators.c: ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) { ... if (op1-type == IS_LONG op2-type == IS_LONG) { double dval = (double) op1-value.lval * (double) op2-value.lval; if ((dval (double) LONG_MAX) || (dval (double) LONG_MIN)) { result-value.dval = dval; result-type = IS_DOUBLE; } else { result-value.lval = op1-value.lval * op2-value.lval; result-type = IS_LONG; } return SUCCESS; ... should that be replaced with: result-value.lval = (long)dval; instead of calculating the multiplication again??? Stefan Esser -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [ZE2] clone_obj function and __clone method
clone_obj is the C handler for overloaded objects. In case of PHP objects clone_obj calls __clone. Andi At 12:37 AM 7/18/2002 -0400, l0t3k wrote: A quick question about the above... what is the relationship between the clone_obj handler and the __clone method. For instance, if i define the clone_obj handler, do i need to define the a __clone method on the same object ? is clone_obj for a shallow and __clone for deep copying ? l0t3k -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Error in zend2_example.phps
Thanks. I've fixed this. Andi At 05:51 PM 7/18/2002 +0200, Sander Steffann wrote: I think zend2_example.phps has a little error in example 6: The display function is defined as: function display() { print $this-name; print \n; } But then it is called with: print $person-getName()-display(); Either the function should use return, or the call shouldn't use print... -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] New FTP extension functionality
At 02:05 PM 7/30/2002 -0400, Joao Prado Maia wrote: So are we going to rename these functions because of this ? It seems kind of weird of having ftp_async_get() when the function is not really asynchronous ;) If what Sterling just said is really accurate, _please_ don't release 4.3.0 with the wrong function names. It just doesn't look professional :) I agree :) It should probably be something like ftp_nb_get(). Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Global Server Variables
Hello, since the last Releases of PHP there is the possibility to switch on and off the transmitting of Variables thru URLs. In the php.ini is written, that its more secure to use Global Server Vars. But I must say, that i have forgotten how to use these. It was something about $HTTP_POST_VARS, but I don't know how to get a chosen value out of it. Can somebody tell me how to write a reference on the values of $HTTP_POST_VARS. Thanx Sascha
[PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/mbstring mbfilter.c mbfilter.h mbregex.c mbstring.c mbstring.h /main rfc1867.c
At 10:38 03.08.2002, Yasuo Ohgaki wrote: Marcus, Don't forget to create patch against development version :) cvs.php.net is _NOT_ for development new encoding/feature. http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/php-i18n/ -- Yasuo Ohgaki O.k. when i am through i will commit changes to cvs.php.net and then to php-i18n. But tell me where is the need for developing that part externally? IT only makes development complicated because there are to diverging versions of php... marcus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] make test broken?
if i do make test i get: = CWD : /home/thies/devel/cgi PHP : /home/thies/devel/cgi/sapi/cli/php PHP_SAPI: cli PHP_VERSION : 4.3.0-dev PHP_OS : Linux INI actual : INI wanted : = TIME START 2002-08-03 13:51:15 = No tests were run. and no tests are run - ist that intended? how do i run the testsuite now? re, tc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] make test broken?
Not really - for me everything is fine - see below. Check your Makefile, it should contain the follwoing lines: test: sapi/cli/php TEST_PHP_EXECUTABLE=$(top_builddir)/sapi/cli/php \ $(top_builddir)/sapi/cli/php -c php.ini-dist $(top_srcdir)/run-tests.php IF not cvsclean/buildconv? marcus make test log: [marcus@zaphod php4]$ make test = CWD : /usr/src/php4 PHP : /usr/src/php4/sapi/cli/php PHP_SAPI: cli PHP_VERSION : 4.3.0-dev PHP_OS : Linux INI actual : /usr/src/php4/php.ini-dist INI wanted : /usr/src/php4/php.ini-dist = TIME START 2002-08-03 15:06:08 = entering directory /usr/src/php4/ext/bz2/tests SKIP BZ2 with files (with_files.phpt) make: *** wait: No child processes. Stop. make: *** Waiting for unfinished jobs make: *** wait: No child processes. Stop. At 13:52 03.08.2002, Thies C. Arntzen wrote: if i do make test i get: = CWD : /home/thies/devel/cgi PHP : /home/thies/devel/cgi/sapi/cli/php PHP_SAPI: cli PHP_VERSION : 4.3.0-dev PHP_OS : Linux INI actual : INI wanted : = TIME START 2002-08-03 13:51:15 = No tests were run. and no tests are run - ist that intended? how do i run the testsuite now? re, tc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] ext/standard/tests/general_functions/proc_open.phpt
Self explanatory: Index: ext/standard/tests/general_functions/proc_open.phpt === RCS file: /repository/php4/ext/standard/tests/general_functions/proc_open.phpt,v retrieving revision 1.1 diff -u -r1.1 proc_open.phpt --- ext/standard/tests/general_functions/proc_open.phpt 23 May 2002 10:46:06 - 1.1 +++ ext/standard/tests/general_functions/proc_open.phpt 3 Aug 2002 13:54:59 - -19,6 +19,11 $ds, $pipes ); +/* As per manual: avoid deadlock */ +for($i=0;$icount($pipes);$i++) +{ + fclose($pipes[$i]); +} proc_close($cat); Met vriendelijke groeten / With kind regards, Webmaster IDG.nl Melvyn Sopacua -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] ZEND_* instead of PHP_*
The CODING_STANDARDS document recommends the use of the ZEND_* macros instead of the PHP_* ones (point 7). Use ZEND_* macros instead of PHP_* macros. This patch makes the CODING_STANDARDS, README.EXT_SKEL, and skeleton directory use the ZEND_FE and ZEND_FUNCTION in place of the PHP_ counterparts. This should encourage developers of new extension modules to use the ZEND_ macros in place of the PHP_ ones. This is bogus, usage should be consistent, but neither one is really better... -Sterling dave == PATCH inlined here == diff -ruNbB ../php-4.2.2.ORIG/CODING_STANDARDS ./CODING_STANDARDS --- ../php-4.2.2.ORIG/CODING_STANDARDSWed Feb 27 22:31:09 2002 +++ ./CODING_STANDARDSFri Aug 2 09:56:42 2002 -68,7 +68,7 -- [1] Function names for user-level functions should be enclosed with in -the PHP_FUNCTION() macro. They should be in lowercase, with words +the ZEND_FUNCTION() macro. They should be in lowercase, with words underscore delimited, with care taken to minimize the letter count. Abbreviations should not be used when they greatly decrease the readability of the function name itself. -169,7 +169,7 /* {{{ proto int abs(int number) Returns the absolute value of the number */ -PHP_FUNCTION(abs) +ZEND_FUNCTION(abs) { ... } diff -ruNbB ../php-4.2.2.ORIG/README.EXT_SKEL ./README.EXT_SKEL --- ../php-4.2.2.ORIG/README.EXT_SKEL Wed Aug 1 22:49:23 2001 +++ ./README.EXT_SKEL Fri Aug 2 09:57:37 2002 -148,7 +148,7 /* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y[, int color]) */ -PHP_FUNCTION(my_drawtext) +ZEND_FUNCTION(my_drawtext) { zval **image, **text, **font, **x, **y, **color; int argc; diff -ruNbB ../php-4.2.2.ORIG/ext/skeleton/create_stubs ./ext/skeleton/create_stubs --- ../php-4.2.2.ORIG/ext/skeleton/create_stubs Tue Dec 18 03:16:53 2001 +++ ./ext/skeleton/create_stubs Fri Aug 2 09:50:58 2002 -226,7 +226,7 convert(i, j, 1) } - proto = proto closeopts )\nfcomments[i] */\nPHP_FUNCTION( funcs[i] )\n{ + proto = proto closeopts )\nfcomments[i] */\nZEND_FUNCTION( funcs[i] )\n{ if (maxargs[i]0) { fetchargs = fetchargs ) == FAILURE) closefetch \n\t\treturn;\n } -254,11 +254,11 print }\n/* }}} */\n stubfile if (stubs) { - h_stubs = h_stubs PHP_FUNCTION( funcs[i] );\n - c_stubs = c_stubs \tPHP_FE( funcs[i] ,\tNULL)\n + h_stubs = h_stubs ZEND_FUNCTION( funcs[i] );\n + c_stubs = c_stubs \tZEND_FE( funcs[i] ,\tNULL)\n } else { - print PHP_FUNCTION( funcs[i] ); extname /function_declarations - print \tPHP_FE( funcs[i] ,\tNULL) extname /function_entries + print ZEND_FUNCTION( funcs[i] ); extname /function_declarations + print \tZEND_FE( funcs[i] ,\tNULL) extname /function_entries } if (xml) print xmlstr xmldoc diff -ruNbB ../php-4.2.2.ORIG/ext/skeleton/php_skeleton.h ./ext/skeleton/php_skeleton.h --- ../php-4.2.2.ORIG/ext/skeleton/php_skeleton.h Wed Aug 8 21:47:47 2001 +++ ./ext/skeleton/php_skeleton.h Fri Aug 2 09:51:44 2002 -22,7 +22,7 PHP_RSHUTDOWN_FUNCTION(extname); PHP_MINFO_FUNCTION(extname); -PHP_FUNCTION(confirm_extname_compiled); /* For testing, remove later. */ +ZEND_FUNCTION(confirm_extname_compiled); /* For testing, remove later. */ /* __function_declarations_here__ */ /* diff -ruNbB ../php-4.2.2.ORIG/ext/skeleton/skeleton.c ./ext/skeleton/skeleton.c --- ../php-4.2.2.ORIG/ext/skeleton/skeleton.c Sat Dec 1 16:59:44 2001 +++ ./ext/skeleton/skeleton.c Fri Aug 2 09:54:28 2002 -21,7 +21,7 * Every user visible function must have an entry in extname_functions[]. */ function_entry extname_functions[] = { - PHP_FE(confirm_extname_compiled,NULL) /* For testing, remove later. */ + ZEND_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */ /* __function_entries_here__ */ {NULL, NULL, NULL} /* Must be the last line in extname_functions[] */ }; -135,7 +135,7 /* Every user-visible function in PHP should document itself in the source */ /* {{{ proto string confirm_extname_compiled(string arg) Return a string to confirm that the module is compiled in */ -PHP_FUNCTION(confirm_extname_compiled) +ZEND_FUNCTION(confirm_extname_compiled) { char *arg = NULL; int arg_len, len; -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit:
Re: [PHP-DEV] [PATCH] ext/standard/tests/general_functions/proc_open.phpt
Committed. Thanks! -James On Sat, 3 Aug 2002, Melvyn Sopacua wrote: Self explanatory: Index: ext/standard/tests/general_functions/proc_open.phpt === RCS file: /repository/php4/ext/standard/tests/general_functions/proc_open.phpt,v retrieving revision 1.1 diff -u -r1.1 proc_open.phpt --- ext/standard/tests/general_functions/proc_open.phpt 23 May 2002 10:46:06 - 1.1 +++ ext/standard/tests/general_functions/proc_open.phpt 3 Aug 2002 13:54:59 - -19,6 +19,11 $ds, $pipes ); +/* As per manual: avoid deadlock */ +for($i=0;$icount($pipes);$i++) +{ + fclose($pipes[$i]); +} proc_close($cat); Met vriendelijke groeten / With kind regards, Webmaster IDG.nl Melvyn Sopacua -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: bader
Translating the documentation To Arabic. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
Alan Knowles wrote: Ok, had a play with this updated copy on http://docs.akbkhome.com/threads.tgz added a few of pthreads calls to TSRM.c did most of the testing without this abstraction layer - just to see if I could get it to work. used php_exectute_script, rather than getting clever and copying the function/class hashtables. results: It worked (with a few caveats - that are just a matter of getting to know threading better)... some of the issues: -if the child thread finishes before the main one - then the main one needs to wait somehow.. Do you mean the other way around? ** FIX = probably need to keep a count of threads that are running and block at MSHUTDOWN on the main thread if stuff is still going. The thread variable needs to be a resource, or tracked somehow, by the parent thread. Each parent thread needs to wait for child threads before ending. -the child thread needs to have the modules functions loaded before it starts running really - otherwise you get intermitant 'functions not available' if you dont dl() the module in the child thread. Fixed by loading in ini file. ** FIX = I need to look at the pthreads equivalant for tsrm_wait_event(thread.start_event,TSRM_INFINITE); will be.. this should make sure that the main thread doesnt do anything while the main thread is starting up.. I'm writing up rough equivelents to this, using pthread_cond_* functions. It will need work by someone using linux. - php_request_shutdown(NULL); calls the MSHUTDOWN for all modules - a good example of where this cause trouble is the ext/standard/string.c MSHUTDOWN, which has a static mutex that is freed. (and would be freed twice when the main thread finishes) - hence php_request_shutdown(), probably doesnt want to be called on a thread completion.. ** FIX = not sure? - does this need fixing or should we just ignore php_request_shutdown.. This is because you are dl'ing the module. When you do that, *unfortunately*, the module is unloaded per request. In the module shutdown, we should wait for all threads that were started to shutdown. But the use of a global mutex should not be necessary once things are more developed. Loading from ini will fix this. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
Andi Gutmans wrote: By the way, if we do end up making this kind of thing mainstream we should probably use APR (or another library) for thread abstraction. I wouldn't want to do all of that work over. Andi That would be nice, but not sure how realistic at this point. Idealy, we would be using APR throughout PHP. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Weird?!?!
I don't think it's identical. Casting to long truncates, which means you may have an answer which is off by one. At 11:28 03/08/2002, Andi Gutmans wrote: I think this is a good question. I'm not quite sure that casting dval to long is the same as multiplying the two longs. Anyone know the answer? Andi At 02:28 PM 7/31/2002 +0200, Stefan Esser wrote: Hi, Could someone tell me why the Zend Engine calculates every multiplication 2 times??? zend_operators.c: ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) { ... if (op1-type == IS_LONG op2-type == IS_LONG) { double dval = (double) op1-value.lval * (double) op2-value.lval; if ((dval (double) LONG_MAX) || (dval (double) LONG_MIN)) { result-value.dval = dval; result-type = IS_DOUBLE; } else { result-value.lval = op1-value.lval * op2-value.lval; result-type = IS_LONG; } return SUCCESS; ... should that be replaced with: result-value.lval = (long)dval; instead of calculating the multiplication again??? Stefan Esser -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
I've cleaned things up a bit, removed code from tsrm and added it to a new file, and commited to pecl. This way those interested can start playing with and developing the module. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] New mbstring
Marcus Börger wrote: At 10:38 03.08.2002, Yasuo Ohgaki wrote: Marcus, Don't forget to create patch against development version :) cvs.php.net is _NOT_ for development new encoding/feature. http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/php-i18n/ -- Yasuo Ohgaki O.k. when i am through i will commit changes to cvs.php.net and then to php-i18n. But tell me where is the need for developing that part externally? IT only makes development complicated because there are to diverging versions of php... marcus I agree. We might create new branch for new mbstring. New filter is great, but it's not stable enough and we don't have much time since there will be 4.3.0 soon. Currently, it works. However,there are problems in the filter, newer encodings are not ported, etc. Your help is very appreciated :) -- Yasuo Ohgaki -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
At 12:40 PM 8/3/2002 -0700, Shane Caraveo wrote: Andi Gutmans wrote: By the way, if we do end up making this kind of thing mainstream we should probably use APR (or another library) for thread abstraction. I wouldn't want to do all of that work over. Andi That would be nice, but not sure how realistic at this point. Idealy, we would be using APR throughout PHP. I'm not saying we should change all of PHP right now but if you're going to add thread function abstractions then we might as well use APR. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
This isn't always ideal. I would rather see the threads as a function not a separate file. Forcing threads to a file would be pretty limited. -brad --- Andi Gutmans [EMAIL PROTECTED] wrote: I still think that if you're going to implement such a thread extension it shouldn't try and copy it's parents data-structures. It'd be very slow and prone to errors. I think giving a filename as the starting point of the thread would be the best solution. It'd mean that the thread is pretty much a completely new request. It would also mean much leaner threads as you could create .php files with only the logic the thread requires. Andi At 02:30 PM 8/3/2002 -0700, Shane Caraveo wrote: I've cleaned things up a bit, removed code from tsrm and added it to a new file, and commited to pecl. This way those interested can start playing with and developing the module. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
At 09:20 PM 8/3/2002 -0700, Brad LaFountain wrote: This isn't always ideal. I would rather see the threads as a function not a separate file. Forcing threads to a file would be pretty limited. I don't think it's that limited. I also don't think that duping the whole thread's address space is a good idea. It's slow and prone to errors. Andi -brad --- Andi Gutmans [EMAIL PROTECTED] wrote: I still think that if you're going to implement such a thread extension it shouldn't try and copy it's parents data-structures. It'd be very slow and prone to errors. I think giving a filename as the starting point of the thread would be the best solution. It'd mean that the thread is pretty much a completely new request. It would also mean much leaner threads as you could create .php files with only the logic the thread requires. Andi At 02:30 PM 8/3/2002 -0700, Shane Caraveo wrote: I've cleaned things up a bit, removed code from tsrm and added it to a new file, and commited to pecl. This way those interested can start playing with and developing the module. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
Andi Gutmans wrote: At 12:40 PM 8/3/2002 -0700, Shane Caraveo wrote: Andi Gutmans wrote: By the way, if we do end up making this kind of thing mainstream we should probably use APR (or another library) for thread abstraction. I wouldn't want to do all of that work over. Andi That would be nice, but not sure how realistic at this point. Idealy, we would be using APR throughout PHP. I'm not saying we should change all of PHP right now but if you're going to add thread function abstractions then we might as well use APR. Andi Well, the thread abstractions by themselves are fairly light weight, whereas going to apr requires more effort. ie., a single file with a few abstractions is not dependent on a whole library of stuff. I do think APR would be ideal, especially since php is used so much with apache in the first place, but for a few simple functions I don't see it making sence to do it right now. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
Andi Gutmans wrote: I still think that if you're going to implement such a thread extension it shouldn't try and copy it's parents data-structures. It'd be very slow and prone to errors. Andi, Currently only the thread_include function that Alan wrote works. I have idea's for doing the other thing without having to copy stuff, and without using mutexes in the engine. Basicly, the idea is to recompile the file, but rather than start execution as normal, call into a function within the file. This gets us a middle ground that makes starting the thread easy, while allowing a function to be the target of the thread start function (which I *realy* prefere). I'm also thinking that it might be possible to set up a 'shared' interpreter on it's own thread that doesn't run anything, but is just used to store zval's for the other threads. When a thread_set/get is called, it actually comunicates with this extra thread to set/get the shared vars. Since you know the engine much better than me ;), what do you think of these idea's? Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php