Re: [PHP-DEV] 64bit PHP on solaris
Even so, I don't know what would be hard for anyone to understand about my patches (and no-one has asked me in the past). If you think there simply too many of them, most of them are probably whitespace disagreements between what you committed and what the PHP style appears to be. The basis of all my streams patches is like this (from the old streams.c): James - speaking for myself - I had no problems with your patch, size, whitespace or otherwise. As I mentioned before, I like to understand that which I commit before I do so. Sometimes seeming illogical code can be correct, and so I try to understand what is proposed - and sometimes I even learn something new :-) In the case shown below, I had a hard time tracing the call stack back by code inspection 'cause I did not understand the mechanisms involved (I do love these indirect methods of calling things, they make debuging so fun :-) Now that I understand the semi-tortuous means to arrive at the line in question, I wholeheartedly endore the following change. All 28 calls that arrive at this line do indeed pass an int - and that was the real reason I was holding off - I wanted to check that was the case. Wez, as streams is your baby - can you commit this ? (How is that for coordination :-) Jani, as 4.3.2 is your baby - will you approve it ? Dave Index: main/streams.c === RCS file: /repository/php4/main/Attic/streams.c,v retrieving revision 1.125.2.37 diff -u -u -r1.125.2.37 streams.c --- main/streams.c 6 Mar 2003 20:58:19 - 1.125.2.37 +++ main/streams.c 8 Mar 2003 10:48:16 - @@ -1532,7 +1532,7 @@ } if (ret) { fflush(data-file); - *ret = (void*)fd; + *(int*)ret = fd; } return SUCCESS; default: What have I done? Well, someone's taking fd (declared as an 'int', which may be 32 bits on some systems), casting it a void* (a 64-bit value on some systems) and then stuffing that into storage space which, although it might not be obvious, happens to be only 32 bits wide. My patch takes fd (the 'int') and stuffs it into 'int' storage. Now that's not to say that the destination IS actually an 'int' but merely that I am keeping the int at its original width rather than casting it up. It's not a 'perfect solution', but it's not a 'perfect problem', either. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] 64bit PHP on solaris
CRIPES, people! I posted patches in November 2002 (admittedly, it was a large patch and probably no one got to check it all out). Then, I reposted them (and sent then directly to you, Dave!) a few days ago. And I got all but the three files merged that are probably causing his problem too - sigh- Sorry but I don't commit what I don't understand, and the three streams files needed some more understanding on my part. In those areas the php5 head differs quite a bit from the 4_3 stream. And on top of that I got diverted by a bug in the session stuff too. Well as I always say in my volunteer posts - if you don't like the job I am doing - cut my pay, if you like what I am doing you can double it - either way the result is the same :-) I will try to get the file descriptors stuff in by early next week. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] 64bit PHP on solaris
CRIPES, people! I posted patches in November 2002 (admittedly, it was a large patch and probably no one got to check it all out). Then, I reposted them (and sent then directly to you, Dave!) a few days ago. And I got all but the three files merged that are probably causing his problem too - sigh- Sorry but I don't commit what I don't understand, and the three streams files needed some more understanding on my part. In those areas the php5 head differs quite a bit from the 4_3 stream. And on top of that I got diverted by a bug in the session stuff too. Well as I always say in my volunteer posts - if you don't like the job I am doing - cut my pay, if you like what I am doing you can double it - either way the result is the same :-) I will try to get the file descriptors stuff in by early next week. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] 64bit PHP on solaris
Please coordinate with me on streams issues; if some 64bit oses declare descriptors as longs rather than ints, then we could have a bigger job on our hands (similar to the mess with socket types under win32). Tru64 HP-UX (and I would guess Solaris and the rest) - the descriptor is an int, which is part of the problem because the streams code in 4.3 casts it wrong. James sent me a patch that included a cast fix, but I have yet to submit it (or try too) because I got caught up in trying to follow the code and then got diverted. I will endevor to finish my look at the patch and see if Jani will let me commit it. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] 64bit PHP on solaris
Which part of please coordinate with me on streams issues didn't you get? ;-) If there are long vs int issues in streams, please let me know where they are and I will fix it. Thanks :) Forgive me if I am a bit dense tonight :-) My 15 yr old son is having a lan party in the basement with about 9 friends and I am tech support and the wine I am drinking to help things is not helping matters :-) Oh to be young again LOL. I will send you the proposed diffs when I get a moment to prepare them and let you submit them as you probably are a better sanity check. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] 64bit PHP on solaris
Chris, some of these changes went in a few days ago, so you want to: cvs co -r PHP_4_3 php4 or grab the release candidate. first file_get_contents readfile both core dump with bus errors b/c the file descriptors are typed as int's when they should be longs (steams.c lines 1020/1156) The lines don't match up to the current code... if you could tell me based on the current lines or give me a code snippet third, and even stranger, is in php_spn_common_handler it calls: zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|ll, s11, len1, s22, len2, start, len) Until a few days ago - there was an int/long issue with many calls to zend_parse_parameter. s need an int, l needs a long. I *think* all of these are fixed correctly. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Moderate PHP-DEV
On Wednesday, March 12, 2003 12:41 PM, Derick Rethans wrote: On Wed, 12 Mar 2003, Sascha Schumann wrote: The list could be renamed so that it is less confusing for newbie PHP developers. What is confusing with this description? Internals list A medium volume list for those who want to help out with the development of PHP (from http://www.php.net/mailing-lists.php) if even that description doesn't work, then nothing would work, not even changing the name. For people who are not great English speakers, there's not much difference between help out with the development of PHP and help with development in PHP. This may not be exactly the correct description, but what about something like: A medium volume list for those who are working on the PHP engine and internals in C and C++. FWIW, I think changing the name would help too. But I'm not the one diligently replying to all the people who incorrectly post to php-dev. :) -dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Moderate PHP-DEV
Aside from renaming the php-dev list, we should remove the 'PHP and Zend Engine internals lists' from the regular mailing list page, put them in a 'developers' section (name isn't important) that describes cvs access, dev email lists, how to build (ie. win32 libraries), etc. As a newbie commiter, still wet behind the ears, I would have *really* appreciated a page that was a little clearer and a bit more up to date than what I started with. My sources of information README.CVS-RULES, the building from cvs web page) were very good, but missed some vital clues. While many have been very patient with me (thanks), I found it frustrating to ask questions that seem to be obvious to others like: * trying to build php4 head for two days, only to be told that I should be building PHP_4_3 or php5 head. * forgetting about re2c, which is not mentioned anywhere that I could find, but I found through freshmeat and had a lovely time trying to build :-) I am taking note of the problems I encountered and was planning on updating something (README.CVS-RULES ?) after another week or so. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [WARNING] Release process for 4.3.2 starts RSN..
On Sun, Mar 09, 2003 at 05:17:37PM +0100, Derick Rethans wrote: | Hello, | | I guess nobody is interested in fixing this? Then I guess we won't get | 4.3.2 ever. | | To get this thing started, I'm going to roll PHP 4.3.2-pre1 | on Wednesday, 26th Feb, around 3pm EEST. And I'll announce | it on php-general too, to get some more people testing it | before we start with any RCs. | | Following is collection of bugs marked as critical and verified | which should be looked into and dealt with. If not fixed, | then please, PLEASE add some comment why they won't ever | be fixed and bogus the out. Hi Derick: I hate to be a pain, but would it be possible to get bug #22510 (http://bugs.php.net/bug.php?id=22510) looked at or assigned before 4.3.2 goes out the door? It's a refcount problem that leads to a double-free; verified and everything. I've been stepping through code on and off for the past week, but seeing that I know little to nothing about Zend's internals, there's probably lots of people who could take care of this much more easily. P.S. Where should I send the Finlandia? ;-) Thanks a lot, - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Further outstanding 64-bit issues with PHP_4_3
Thanks, will look at these and see if I can't get them in with Jani's permission. The OnUpdateLong is in my cvs queue, but I was getting a karma issue on Friday. Out of curiosity - which platform do you use ? I am on Tru64 and am working with the HP-UX folks. It would be interesting to know what other 64bit platforms are being covered/used. Once I went to the PHP_4_3 tree I did not encounter any configuration issues, other than the flex check, and as I had backed off to an older version, that was not a problem either for me anymore. Dave Just looking at CVS diffs (can't compile at the moment due to ./configure breakage), I can see... Remaining zend_parse_parameters problems: php4/ext/ftp/php_ftp.c php4/ext/sockets/sockets.c General LP64 incompatabilities left over from my November patches: php4/ext/pgsql/pgsql.c php4/ext/standard/url_scanner.c php4/ext/standard/url_scanner_ex.c php4/main/network.c php4/main/streams.c (Need to check: is _php_stream_cast safe? If not, then main/streams/cast.c in HEAD is probably not) php4/main/streams/plain_wrapper.c php4/main/streams/xp_socket.c And of course the OnUpdateLong stuff, but I guess that's in process. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] fun with autoconf on Tru64
What does this output? flex -V -v --version 2/dev/null - Sascha # flex-2.5.27/flex -V -v --version 2/dev/null flex 2.5.27 # flex-2.5.4/flex -V -v --version 2/dev/null flex-2.5.4/flex version 2.5.4 Nice consistancy eh ? Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] fun with autoconf on Tru64
# flex-2.5.27/flex -V -v --version 2/dev/null flex 2.5.27 This should be parsed correctly. What kind of OS and /bin/sh OS == Tru65, shell is /bin/sh do you have? What does ver1=2.5.27 ver2=2 5 27 set $ver2; echo $3 27 IFS=.; set $ver1; echo $3 27 The test in php4/configure.in (and php5/configure.in) is set `echo | $LEX -V -v --version 2/dev/null | grep 'version' | cut -d ' ' -f 3 | sed -e 's/\./ /g' | sed -e 's/[^0-9 ]//g'` if test ${1} != 2 -o ${2} != 5 -o ${3} -lt 4; then In the newer flex output it does not have the work 'version' in it, and the version is the second not the third arg which is why this test fails. changing that to set `echo | $LEX -V -v --version 2/dev/null | sed -e 's/^.* //' -e 's/\./ /g' works for me in both cases. It also handles this case: # flex-2.5.4/flex -v -V --version 21 flex-2.5.4/flex version 2.5.4 which has a double version number. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] fun with autoconf on Tru64
I set up a debian linux box and after getting the right versions of things I am still getting the same results from configure. I am getting a syntax error saying else unexpected. With php5 module HEAD? No - php4 HEAD, should I be doing this with php5 instead ? What line is the error at? What does running the build/buildcheck.sh script output for the tool versions? # ./buildconf using default Zend directory buildconf: checking installation... buildconf: autoconf version 2.13 (ok) buildconf: automake version 1.5 (ok) buildconf: libtool version 1.4.3 (ok) rebuilding configure rebuilding acconfig.h rebuilding main/php_config.h.in # CC='cc -std1' ./configure (I normally add more options - but I am trying to get the simple case to work) ... checking style of sigwait... other checking style of sigwait... other checking for mysqli support... no -l ./configure[53629]: syntax error at line 53630 : `else' unexpected $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so echo * else ODBC_LFLAGS=-L$ODBC_LIBDIR ODBC_LIBS=-l${ac_solid_prefix}${ac_solid_os}${ac_solid_version} fi echo $ac_t`echo $ODBC_LIBS | sed -e 's!.*/!!'` 16 else 53629 echo $ac_tno 16 fi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] fun with autoconf on Tru64
Thank you all for you tips and pointers on this build issue. Once I switched to the PHP_4_3 tree I things got much better :-) I built it and hand installed the .so and am seeing a phpinfo() page in my browser. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] fun with autoconf on Tru64
You shouldn't :) m4-1.4 without the 'o'. Thanks ! That does help some. I don't get the buildconf warnings now, but I am still getting shell syntax errors in the resulting configure script. arrrgh :-p Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] fun with autoconf on Tru64
Thanks ! That does help some. I don't get the buildconf warnings now, but I am still getting shell syntax errors in the resulting configure script. arrrgh :-p Make sure that autoconf-2.13 is completely reinstalled (including rm -rf autoconf-2.13). Otherwise, the frozen files which were generated using m4-1.4o cause problems. Thanks, I did purge my tools tree and rebuilt all of them. Moving on to the next bug, it would seem that flex changed how it reports versions differently # ./flex --version ./flex version 2.5.4 # ./flex --version flex 2.5.27 and the code that checks for the right flex will work right with 2.5.4 but not with 2.5.27, the result is a set command with no args which causes my env to be burped out. The change is needed in configure.in (I think). So I backed up to flex 2.5.4 :-p After that, I get a syntax error related to ext/odbc/config.m4. Don't understand why, but I get a script block that is missing the first half of an if then else fi construct. I tried working around this by zeroing the config.m4 file, as I am not using odbc anyway, but that only moved the problem down a module or two. I set up a debian linux box and after getting the right versions of things I am still getting the same results from configure. I am getting a syntax error saying else unexpected. I encountered what appears to be a typo in odbc/config.m4: + PHP_EVAL_LIBLINE([$ODBC_LFLAGS $ODBC_LIBS], OBDC_SHARED_LIBADD) that should probably be ODBC, but it had nothing to do with my build problem. At this point I have spent about 10 hours on this and am no closer to being able to build test my changes. Anyone have any ideas ? Anyone want to send me a ./configure that works with HEAD ? As I can only compile a part of the zend_parse_parameter changes I have proposed, I will becommiting them anyway in a moment. I will also need to commit the OnUpdateInt/Long changes tommorow (friday) so Jani can do the 4.3.2 kit. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] - 64 bit issue with zend_parse_parameters calls
Just commit these.. I will - give me a couple of days though - given that it is my first commit with php I want to triple check that I have got the process correct before I push the button :-) Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] - fix for 64 bit issues with OnUpdateInt
A single API is probably sufficient but I can understand that extension writers might want to use ints. The INI flag might have nothing to do with an internal zval and an int might be more than enough. I don't really mind but I wouldn't introduce OnUpdateInteger. I guess we should either move everything to OnUpdateLong() and nuke OnUpdateInt() in ZE2 or we change OnUpdateInt to work with ints and fix the whole code. It might be less confusing to just have one. I agree about the confusing part. My suggestion is: * we leave OnUpdateInt as is currently for BC, deprecating it now, removing it in (? php 5.x == ZE2 ?) * convert everything in the code base to OnUpdateLong, which means I change the arguments passed into the call where needed (yipee I get to do another code sweep :-) This fixes the symantic problem and sets the stage for how to proceed in the future. * update the documentation with a note reminding people that int and long are not the same thing, both for OnUpdateInt and for zend_parse_parameters (I found zend_parse_parameters in the docs but not OnUpdateInt, any hints ?) I *think* this would work with all of the comments I have seen on this issue. I will start coding today, and if people are ok with it I will commit on Friday (to allow time for comment) so that Jani can move on 4.3.2. dave
[PHP-DEV] pg_lo_open and object creation... intended behavior?
Hi: This is an excerpt from ext/pgsql/pgsql.c, in pg_lo_open: --- if (strchr(mode_string, 'w') == mode_string) { pgsql_mode |= INV_WRITE; create = 1; if (strchr(mode_string, '+') == mode_string+1) { pgsql_mode |= INV_READ; } } pgsql_lofp = (pgLofp *) emalloc(sizeof(pgLofp)); if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { if (create) { if ((oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == 0) { efree(pgsql_lofp); php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to create PostgreSQL large object.); RETURN_FALSE; } else { if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { if (lo_unlink(pgsql, oid) == -1) { efree(pgsql_lofp); ... } ... registers resource and returns ... --- If I'm reading this correctly, it looks like a call to pg_lo_open (with an object identifier specified explicitly in $oid) can theoretically return a file handle pointing to a different, newly-created large object in the case that the initial open failed. If this is the case, it seems unintuitive and very cumbersome to handle from user-space. Can we change the 'if (create) {' branch to only be triggered when the oid was left unset (ensuring that the open() failure actually gets back to the caller)? Best Regards, - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Doing something with an each opcode as zend_execute() handles it
Just before zend_execute()/execute() handles each opcode in its big switch() statement, I'd like to be able to call a function and pass it the opcode (or other information from the opline. Is the best approach to reset zend_execute to a new function in the PHP_MINIT_FUNCTION() (and restore the saved value in PHP_MSHUTDOWN_FUNCTION)? This new function would mostly be a copy of execute() in zend_execute.c with my addtional function call tossed in. What's the difference between zend_execute() and zend_execute_internal()? Thanks, David -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Doing something with an each opcode as zend_execute() handles it
On Wednesday, March 05, 2003 5:35 PM, Sterling Hughes wrote: Just before zend_execute()/execute() handles each opcode in its big switch() statement, I'd like to be able to call a function and pass it the opcode (or other information from the opline. Is the best approach to reset zend_execute to a new function in the PHP_MINIT_FUNCTION() (and restore the saved value in PHP_MSHUTDOWN_FUNCTION)? This new function would mostly be a copy of execute() in zend_execute.c with my addtional function call tossed in. What's the difference between zend_execute() and zend_execute_internal()? Well, I have a feeling what you are talking about is sub-optimal, what do you want to do? Essentially, I want to be able to produce a sort of serialized representation of the opcodes, but as they are executed, not all in one big chunk after they are compiled. This isn't for any actually useful production code, just some debugging/messing around/exploring engine internals. David -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Doing something with an each opcode as zend_execute() handles it
On Wednesday, March 05, 2003 5:46 PM, Sterling Hughes wrote: Essentially, I want to be able to produce a sort of serialized representation of the opcodes, but as they are executed, not all in one big chunk after they are compiled. This isn't for any actually useful production code, just some debugging/messing around/exploring engine internals. I would suggest you take a look at Ze2's execution architecture, it should allow you to do this. Such as overriding the opcode handlers for each opcode? I suppose I could change what the handlers are initialized to in zend_init_opcodes_handler() so that my new handler does the serialization and then calls the regular handler. Does that make sense? On Wednesday, March 05, 2003 6:10 PM, George Schlossnagle wrote: There's no good way to do this as a zend_extension in ZE1 (that I know of). You need to patch the engine (which is trivial). Yeah, so far I'm just using a different zend_execute.c with my added code, I was just wondering if there's a better/more formal/etc way to do it... Thanks, David -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] - fix for 64 bit issues with OnUpdateInt
So for 4.3.2, we add the OnUpdateLong() and replace all the calls to OnUpdateInt() to use that instead and we leave the OnUpdateInt() behaviour same as it was. This shouldn't cause BC problems then..? If you want to leave the current OnUpdateInt behavior (uses long * internally) ... then that will require some additional changes, as there are a dozen or so places where an int is currently passed to OnUpdateInt, which I left as is because I changed to using OnUpdateLong where a long was used. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: ddhill
Would like to contribute 64 bit related corrections to PHP core and extensions. Will be feeding changes found by the HP Tru64 and UX teams back. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] - fix for 64 bit issues with OnUpdateInt
The patch I sent in should have all of the OnUpdateLong changes in them, and the remaining OnUpdateInt should probably be OnUpDateInteger. The painful part was actually looking at what was passed to match up the calls. That might save you some time. dave hill Yes, I know, but we need to remain backwards compatible so I'm adding OnUpdateInteger() and OnUpdateLong(). This leaves OnUpdateInt() as it is now. Just need to go through the extensions and change the necessary OnUpdateInt()'s to OnUpdateLong(). -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] - fix for 64 bit issues with OnUpdateInt
Is there any specific reason why a single API (OnUpdateLong) is not sufficient? Is not it a safe assumption that those modules which still use 'int's are simply the result of a mistake on the developer's side? This is a reasonable assumption actually I can't think of a case where a long would not work in place of an int. And given that you are talking of only a handfull that would be changed, size would not be an issue. Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] - fix for 64 bit issues with OnUpdateInt
So I think the fix of adding OnUpdateLong() is the correct fix. I was under the impression that OnUpdateInt was actually expecting a long. I remember changing some int's to long's to address 64 bit issues. Do I remember this incorrectly? - Sascha Most, but not all of the calls to OnUpdateInt were long, and at least one of the mismatches was in main (three longs in a row followed by an int look at output_buffering in main.c). I personally don't care which way the team wants to fix this. My thought was the making the name say long was the best way to avoid silly errors in the future. If you want some consistency, then you could always retire OnUpdateInt and force them all to be long :-) It is not as if an extra few bytes would be noticed. Part of the problem is that many people still think an int and a long are interchangeable - and they actually are when the compiler knows what it is dealing with. The problem is when you start passing pointers around and casting things, and the compiler can't fix things up for you. This is of course compounded by the fact that on quite a few platforms they are the same size Dave Hill -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Getting an external param into a userspace streams filter...
Hi Wez, everyone: Is there (or will there ever be) a good way to transmit an extra parameter into a php_user_filter around the time that oncreate() is called? I've run into a couple cases where it'd be incredibly useful (e.g. for filters that don't modify the stream, but do have side-effects). Is there a known technical reason why this would be difficult or impossible? If not, can I go ahead and submit a patch at some point? :) Thanks, - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Getting an external param into a userspace streams filter...
On Thu, Feb 27, 2003 at 09:40:15AM -0500, David Brown wrote: | Hi Wez, everyone: | | Is there (or will there ever be) a good way to transmit an extra | parameter into a php_user_filter around the time that oncreate() is | called? I've run into a couple cases where it'd be incredibly useful | (e.g. for filters that don't modify the stream, but do have | side-effects). bool stream_filter_append ( resource stream, string filtername [, string params]) ^^^ Nevermind. Seems I can't read this morning. Sorry about that. - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Getting an external param into a userspace streams filter...
On Thu, Feb 27, 2003 at 09:42:24AM -0500, David Brown wrote: | On Thu, Feb 27, 2003 at 09:40:15AM -0500, David Brown wrote: | | Hi Wez, everyone: | | | | Is there (or will there ever be) a good way to transmit an extra | | parameter into a php_user_filter around the time that oncreate() is | | called? I've run into a couple cases where it'd be incredibly useful | | Nevermind. Seems I can't read this morning. Sorry about that. Well, perhaps I jumped to self-chastisement a bit too quick. There's a single string parameter that can be passed to stream_filter_append / stream_filter_prepend, but how would one retrieve this information once inside of the filter? Moreover, for passing arbitrary zvals in, would I have to resort some hackery using array keys from a global, or is there an easier way? Thanks in advance, - Dave 'Replies to self way too many times' [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Getting an external param into a userspace streams filter...
Hi Wez: On Thu, Feb 27, 2003 at 04:26:40PM +, Wez Furlong wrote: | Hi David, | | user filters are in a little bit of flux atm. | | However, the idea is that the param argument will be altered to be a | zval (rather than just a string). | | In the oncreate() method, the following member variables are available | to the filter: | | string $this-filtername; // name of the filter | mixed $this-params; // params passed from prepend/append func Excellent. :) I did finally find where $this-params gets set (in ext/standard/user_filters.c:242), but I figured a third reply to myself would probably just be embarassing. ;-) | Hope this helps; please only use current CVS for PHP 5 for playing | around with this stuff; if you run into problems let me (and Sara | [EMAIL PROTECTED]) know and we can sort them out. Will do. I'm currently wrapping the experimental streams stuff in a class, falling back to a user-space streams/filter implementation when the PHP 5 one isn't available. I'm currently using the oncreate() method (of my wrapper class) to transmit the parameters to the filter; I just wanted to make sure that this wouldn't bite me when I tried to slide the PHP filter implementation underneath it. Anyway, much thanks. - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Of string constants, bytecode, and concatenation
Hi everyone: This may well be a stupid question, but I've spend enough time staring blankly at zend_compile.c/zend_execute.c that I figured it was time to ask. :) Say I have a section of code like this: ?php $s1 = 'foo' . 'bar' . 'baz'; $s2 = 'foobarbaz'; ? In the PHP bytecode (I hope I'm using the right terminology - I mean the stuff in the opline; the stuff that gets stored in the cache under APC or Zend cache), is there any functional difference between the assignment to $s1 and the assignment to $s2? Or, to put it more precisely, is Zend currently able to figure out that the strings on both sides of the concatenation operator are constants, and don't need to be concatenated at runtime? If not, can anyone explain the barriers to doing something like this? I'm attempting to learn a bit of the gory details of the interpreter, so the more pointers into the source anyone can provide, the better off I'll be. Thanks a lot, - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Of string constants, bytecode, and concatenation
On Wed, Feb 26, 2003 at 05:36:54PM +0100, Derick Rethans wrote: | No, the engine doesn't do this at compile time. This first one produces: | | number of ops: 5 | line # op fetch ext operands | --- |1 0 CONCAT ~1, 'foo', 'bar' | 1 CONCAT ~2, ~1, 'baz' | 2 FETCH_W local $0, 's1' | 3 ASSIGN $3, $0, ~2 |3 4 RETURN 1 | | The second one: | | line # op fetch ext operands | --- |1 0 FETCH_W local $0, 's2' | 1 ASSIGN $1, $0, 'foobarbaz' |2 2 RETURN 1 Is that output a ZEND_DEBUG thing, or is that an external tool? | If not, can anyone explain the barriers to doing something like this? | | It's the job of an optimizer, not of a compiler. And because PHP doesn't | have an internal optimizer, this is not optimized out. You can either Okay. Makes complete sense. I was thinking more along the lines of wouldn't it be nice if...?. I hadn't quite made it to where would that belong?. :) I'll check out the optimizers. I noticed that the new CVS version of APC seems to have a configuration option for optimization as well, though I'm not sure how far along it is. Thanks again, - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] include file when using open_basedir
Hi !! Including or openeing a file fails when all paths defined in include_path are not also defined in open_basedir, regardless if the file to open/include is in both definitions. Imagine include_path = .:/usr/local/lib/php:/usr/local/http-docs open_basedir = .:/usr/local/http-docs trying to include a file on /usr/local/http-docs will fail when _php_stream_fopen_with_path will try to locate the file at usr/local/lib/php . This could be undestand as a configuration error, but in a virtual server farm enviroment it's easy to have include_path defined globaly in php.ini and open_basedir defined for each virtual server. BTW, it's not too good to fail in this situation as the requested file meets all requirements. Also the given error will report 'unable to open /usr/local/lib/php/filename' due to open_basedir restrictions, where the real requested file is /usr/local/http-docs/filename -- Best regards ... I was arrested for selling illegal sized paper. David Saez Padroshttp://www.ols.es On-Line Services 2000 S.L. e-mail [EMAIL PROTECTED] Pintor Vayreda 1 telf+34 902 50 29 75 08184 Palau-Solita i Plegamans movil +34 670 35 27 53 *** streams.c Sun Feb 23 21:32:40 2003 --- streams.c Sun Feb 23 21:34:40 2003 *** *** 1741,1746 --- 1741,1752 end++; } snprintf(trypath, MAXPATHLEN, %s/%s, ptr, filename); + + /* If file does not exist continue */ + if (VCWD_STAT(trypath, sb) == 0) { + ptr = end; + continue; + } if (php_check_open_basedir(trypath TSRMLS_CC)) { stream = NULL; *** *** 1748,1764 } if (PG(safe_mode)) { ! if (VCWD_STAT(trypath, sb) == 0) { ! /* file exists ... check permission */ ! if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC) == 0) || ! php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM)) { ! /* UID ok, or trypath is in safe_mode_include_dir */ ! stream = php_stream_fopen_rel(trypath, mode, opened_path, options); ! } else { ! stream = NULL; ! } ! goto stream_done; } } stream = php_stream_fopen_rel(trypath, mode, opened_path, options); if (stream) { --- 1754,1768 } if (PG(safe_mode)) { ! /* file exists ... check permission */ ! if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC) == 0) || ! php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM)) { ! /* UID ok, or trypath is in safe_mode_include_dir */ ! stream = php_stream_fopen_rel(trypath, mode, opened_path, options); ! } else { ! stream = NULL; } + goto stream_done; } stream = php_stream_fopen_rel(trypath, mode, opened_path, options); if (stream) { -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] warning does not report correct open_basedir
Hi !! open_basedir warning in fopen_wrappers.c does not correctly report the real open_basedir paths, it only reports the path it was actually testing when the test failed. This patch will make it show the correct information. -- Best regards ... I was arrested for selling illegal sized paper. David Saez Padroshttp://www.ols.es On-Line Services 2000 S.L. e-mail [EMAIL PROTECTED] Pintor Vayreda 1 telf+34 902 50 29 75 08184 Palau-Solita i Plegamans movil +34 670 35 27 53 *** fopen_wrappers.cSun Feb 23 21:13:08 2003 --- fopen_wrappers.cSun Feb 23 21:13:40 2003 *** *** 192,198 ptr = end; } php_error_docref(NULL TSRMLS_CC, E_WARNING, ! open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s), path, pathbuf); efree(pathbuf); errno = EPERM; /* we deny permission to open it */ return -1; --- 192,198 ptr = end; } php_error_docref(NULL TSRMLS_CC, E_WARNING, ! open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s), path, PG(open_basedir)); efree(pathbuf); errno = EPERM; /* we deny permission to open it */ return -1; -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] include file when using open_basedir
Hi !! Correction to last submited patch !! Including or openeing a file fails when all paths defined in include_path are not also defined in open_basedir, regardless if the file to open/include is in both definitions. Imagine include_path = .:/usr/local/lib/php:/usr/local/http-docs open_basedir = .:/usr/local/http-docs trying to include a file on /usr/local/http-docs will fail when _php_stream_fopen_with_path will try to locate the file at usr/local/lib/php . This could be undestand as a configuration error, but in a virtual server farm enviroment it's easy to have include_path defined globaly in php.ini and open_basedir defined for each virtual server. BTW, it's not too good to fail in this situation as the requested file meets all requirements. Also the given error will report 'unable to open /usr/local/lib/php/filename' due to open_basedir restrictions, where the real requested file is /usr/local/http-docs/filename -- Best regards ... I was arrested for selling illegal sized paper. David Saez Padroshttp://www.ols.es On-Line Services 2000 S.L. e-mail [EMAIL PROTECTED] Pintor Vayreda 1 telf+34 902 50 29 75 08184 Palau-Solita i Plegamans movil +34 670 35 27 53 *** streams.c Sun Feb 23 21:32:40 2003 --- streams.c Sun Feb 23 21:34:40 2003 *** *** 1741,1746 --- 1741,1752 end++; } snprintf(trypath, MAXPATHLEN, %s/%s, ptr, filename); + + /* If file does not exist continue */ + if (VCWD_STAT(trypath, sb) != 0) { + ptr = end; + continue; + } if (php_check_open_basedir(trypath TSRMLS_CC)) { stream = NULL; *** *** 1748,1764 } if (PG(safe_mode)) { ! if (VCWD_STAT(trypath, sb) == 0) { ! /* file exists ... check permission */ ! if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC) == 0) || ! php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM)) { ! /* UID ok, or trypath is in safe_mode_include_dir */ ! stream = php_stream_fopen_rel(trypath, mode, opened_path, options); ! } else { ! stream = NULL; ! } ! goto stream_done; } } stream = php_stream_fopen_rel(trypath, mode, opened_path, options); if (stream) { --- 1754,1768 } if (PG(safe_mode)) { ! /* file exists ... check permission */ ! if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC) == 0) || ! php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM)) { ! /* UID ok, or trypath is in safe_mode_include_dir */ ! stream = php_stream_fopen_rel(trypath, mode, opened_path, options); ! } else { ! stream = NULL; } + goto stream_done; } stream = php_stream_fopen_rel(trypath, mode, opened_path, options); if (stream) { -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] mb_string overloading and binary data...
Hi: This is kind of a user-space question, but I'm hoping that it concerns enough of the PHP infrastructure (conceptually) that this is the right place to post it. I've got an application that processes both textual and binary data. The domain of the application isn't really relevant, but it makes liberal use of string and pcre function. Ignoring the fact (?) that php_pcre doesn't seem to be mb-aware... Say I were to turn on the mb_string overload support, effectively replacing strlen, etc. with equivalent multibyte functions. Is there any way then to still get the exact size, in bytes, of a 'string' of binary data? In general, I guess the question is 'Is there a preferred way of handling binary data in memory, while remaining multibyte-safe?' Apologies if this is way O/T or has already been beaten to death... - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: tomysk
I'd like to request CVS access to the PEAR/PECL effort so I can contribute a couple of modules I've written. Requested username: daggilli David Gillies San Jose Costa Rica __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: daggilli
Ignore previous subject line, username request is daggilli --- David Gillies [EMAIL PROTECTED] wrote: I'd like to request CVS access to the PEAR/PECL effort so I can contribute a couple of modules I've written. Requested username: daggilli David Gillies San Jose Costa Rica __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: daggilli
Contributing two modules which I hope to become part of PEAR (or maybe even core). One is a module (timezone) to parse tzfile(5) timezone files to find offsets from UTC for a given timezone at an arbitrary time in the past or future (Unix epoch). The other (securesocket) is a module that exposes (at present) approximately 80 functions from the OpenSSL library (including functions for buffered I/O). It is intended for SSL developers that wish to code at a lower level than is offered by the PHP streams mechanism, particularly for rapid porting from C/C++ implementations. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Contributing to PHP - how?
OK, I've been using PHP since about six months after Rasmus decided to share his brainchild with us. Can someone PLEASE point me to the appropriate mechanism to contribute my own modules? I'm sure it's out there, but hours of perusing the PHP site and Google don't help. At present all I have is a tiny module that groks tzfile(5) files to get you historical offsets from UTC, and another one that exposes about 80 or so low-level routines from the OpenSSL library (so you can actually talk SSLv23/TLSv1 - including line-buffered I/O - to port 443/whatever on a webserver without PHP streams), but I'd like to cast them upon the waters (as part-payment for the bread that has already returned to me an hundred-fold). Can someone help? From what I understand, PECL is the best codespace for this. If so, cool (I don't expect my work to hit PHP core - it's itch-scratching code). But how do I contribute it? Best Wishes David Gillies San Jose Costa Rica __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] karma for pear/PECL/myphp
When I try to commit changes to pear/PECL/myphp, I get: Access denied: insufficient karma (sklar|pear/PECL/myphp) Contact [EMAIL PROTECTED] for access to pear/PECL/myphp cvs server: Pre-commit check failed cvs [server aborted]: correct above errors first! E-mails to [EMAIL PROTECTED] produce no response. Could I have karma for this please? Alternatively, I can make a package and upload it to PEAR via the web interface, but since myphp was added to the CVS repository directly, I'm not sure which method is correct. Thanks, David -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Current HEAD segfaults with Horde/CHORA
On Tue, Feb 11, 2003 at 01:18:20PM +0100, Derick Rethans wrote: | On Tue, 11 Feb 2003, Sebastian Bergmann wrote: | | Derick Rethans wrote: |Be that as it may, but it still shouldn't segfault, no? ;-) | | recursive function calls always segfault, just like: | | ?php function a() { a(); }; a(); ? | | so it's 'expected behavior'. I assume the crash on infinite recursion is a stack-overflow type thing, but is there any reason that doesn't trigger the 'Allowed memory exhausted' and exit cleanly? Just curious... :) Thanks, - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Current HEAD segfaults with Horde/CHORA
On Tue, Feb 11, 2003 at 03:17:53PM -0500, Derick Rethans wrote: | David Brown wrote: | | I assume the crash on infinite recursion is a stack-overflow type thing, | but is there any reason that doesn't trigger the 'Allowed memory | exhausted' and exit cleanly? | | Just curious... :) | efficiency :) Adding checks for this will be 1) inaccurate, 2) slow and | thats enough not to do them :) Hi Derick: Sorry about leaving php-dev off of the Cc - your reply didn't make it back to the php-dev list, though you did indeed respond. :) A couple of followup questions: 1. The crashes I'm able to catch with ?php function a(){a();}a(); ? stop GDB at zend_execute line 1489: zend_ptr_stack_n_push(EG(arg_types_stack), 2, EX(fbc), EX(object).ptr); However, zend_ptr_stack_n_push seems to handle growth of the stack, and there aren't pointer dereferences anywhere else. Am I looking at the wrong section of code? The wrong stack, maybe? :) 2. Is the PHP stack size configurable, either at run-time or at compile-time? (That is, assuming it's defined by PHP and not a resource limitation/setting in the OS). Thanks in advance, - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Timezone functions
OK, so I've had a couple of replies stating interest in this. How do I go about contributing my code? Best Wishes David Gillies San Jose Costa Rica --- David Gillies [EMAIL PROTECTED] wrote: My module exposes a single function, timezone_offset(). From the module code: proto int timezone_offset(string zfVal,int timeVal) __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] new idate() - sunrise() - sunset() functions
In a similar itch-scratching moment I whipped up a trivial PHP module that groks tzfile timezone files to give you the offset from GMT at any time in the Unix epoch. I needed this to preflight a bunch of data which had been gathered with a lot of disparate time zones into a single UTC version, but I thought it might merit further dissemination. Anyone interested? Best Wishes David Gillies San Jose Costa Rica sunrise() - sunset() functions __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] [PATCH] new idate() - sunrise() - sunset() functions
From: David Gillies [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 11:18 AM In a similar itch-scratching moment I whipped up a trivial PHP module that groks tzfile timezone files to give you the offset from GMT at any time in the Unix epoch. I needed this to preflight a bunch of data which had been gathered with a lot of disparate time zones into a single UTC version, but I thought it might merit further dissemination. Anyone interested? Yes. Well, at least I am. -dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Timezone functions
My module exposes a single function, timezone_offset(). From the module code: proto int timezone_offset(string zfVal,int timeVal) Return offset from GMT for specified timezone file at specified Unix time. Both parameters are optional. Default is /etc/localtime (unless overridden in initialisation file) and current time of day as returned by time(). In other words, if you call timezone_offset(/usr/share/zoneinfo/Europe/Warsaw,482791331) then it will give you the deviation from UTC in Poland on 19th April 1985 at 14:42:11. It works by parsing files in tzfile(5) format. Can someone point me at a description of the procedure to make a contribution to PEAR or PECL? David Gillies if i grasp u, my new 'idate(Z)' 'll do the job for u. moshe -- --- Moshe Doron [EMAIL PROTECTED] wrote: David Gillies [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In a similar itch-scratching moment I whipped up a trivial PHP module that groks tzfile timezone files to give you the offset from GMT at any time in the Unix epoch. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Using CLI as a shell
There is a difference between interactive mode and this idea. The idea was to execute every single line. So if you type 'echo Hello\n; and press enter Hello should be displayed. i like this idea, so i no longer have to type echo Hello on my bash prompt :) At least with this (presumably) Python style shell you could use readline to prevent you typing echo Hello twice (as opposed to current php -a). :) The Command Shell program in Recipe 20.9 of the PHP Cookbook uses readline() to implement a PHP shell-style prompt, where each line is executed as you type it. It also uses readline_completion_function() to provide tab-completion for function names. You can download it in the archive of code from the book at: -- http://examples.oreilly.com/phpckbk/ -dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: #21659 [Com]: sprintf
On January 15, 2003 10:27 am, Adam Wright wrote: Last ditch effort of NotAPHPBug? ;) This too may not be a correct solution all the time. Consider 75th duplicate report of an invalid or even a resolved bug report. It may have been a bug at some point, but certainly is not anymore. It is bogus, because the user chose not to search in the bug database for similar reports before posting their report. Surely you can agree that such a report is bogus. I suppose we could introduce a dozen different more 'friendly' statuses to replace the existing bogus status, but why? Surely not for the purpose of making users who don't do the necessary research before posting their bug reports feel better about themselves. The wording could be something like NotValidBug or something like that. I think the issue that Adam is bringing up is that Bogus has a derogatory connotation. Changing it doesn't necessarily make users who don't do necessary research before posing feel better about themselves, but it may make people more willing to report actual bugs in the future. Look, I'm not on the QA team and ultimately, what makes it easiest and most worthwhile for you guys to find and fix bugs is the best thing to do. But I can easily see how a well-meaning person who might be new to PHP might report what they think is a bug, have their bug report closed with This isn't a bug. with the status changed to Bogus, and take that as a big fat Go away. PHP doesn't welcome you. Maybe their report was a bug in something else (like that XML bug that was discussed recently) or maybe they didn't make themselves clear enough in their report. Derick's suggestion of making sure that the reason why the bug is Bogus is included in the discussion help with this. But it's pretty easy for someone to get discouraged by a curt dismissal and then not offer help in the future. If you guys are inundated with bogus bugs, then perhaps this is all moot. I can just see how easy it might be for someone who isn't an initiate to get a bad taste in their mouth for PHP by an unfortunate interaction with the bug system. -dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: #21659 [Com]: sprintf
From: Ilia A. [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 15, 2003 11:19 AM Consider the following, there are a lot more PHP users then PHP developers and considering that not all PHP developers are actively involved in the bug solving process (many are involved with PEAR/PECL/Documentation and so on) there are very few people actively working on resolving bugs. This makes the time of these people very valuable, people who post invalid bug reports eat up that valuable time and by doing so not only cause a loss of bug fixing time but also disillusion developers and often make them move on to more exciting things like writing new code. Perhaps a slightly less then an absolutely polite approach, will make those people reconsider their bug posting technique and do a little research before deciding that their non-working script constitutes a valid bug report and start wasting everyone's time. Most of the time when a bug is marked bogus the developer will indicate why the bug is bogus, so that the user is not left in the dark. Like I said, ultimately, whatever works best for the folks actively resolving the best approach. My only point was that the people posting the bugs often aren't aware of these dynamics beforehand, so the less then an absolutely polite approach, which makes sense when you explain it here, can be discouraging. All that said, I see nothing especially inflammatory about 'bogus' and I do not believe it is the intent of the developers to insult or degrade the user who had posted a bogus report. The 'invalid' status that was proposed, in my opinion, just as 'unfriendly' as bogus. I don't think that anyone thinks it's the intent of developers to insult or degrade users. -dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fwd: Re: [PHP-DEV] ext_skel
OK, how about a much-expanded version for 4.3.1, say? I'm a big fan of self-documenting code (use the source, Luke). Perhaps a default function with all the bells and whistles (checking for references, grabbing a resource, etc, all documented up the wazoo). Best Wishes David Gillies San Jose Costa Rica --- Andi Gutmans [EMAIL PROTECTED] wrote: To: David Gillies [EMAIL PROTECTED] From: Andi Gutmans [EMAIL PROTECTED] Subject: Re: [PHP-DEV] ext_skel Yeah but then it might make sense to print something like Argument passed = , no? Andi At 08:56 AM 12/23/2002 -0800, David Gillies wrote: Well, if nothing else, for the novice extension developer it gives an example of how to retrieve an argument, without having to go to the Zend API docs. Best Wishes David Gillies San Jose Costa RIca --- Andi Gutmans [EMAIL PROTECTED] wrote: Hey, What's the reason that confirm_myextension_compiled(..) takes a string as an argument? Why doesn't it just use the string myextension in it's message? For those who don't remember it prints out Congratulations! You have successfully modified ext/myextension/config.m4. Module myextension is now compiled into PHP.. The second appearance of myextension is the parameter passed to the function. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] OpenSSL wrappers for PHP 4
Hi, I'm new to this list... Over the past few weeks I've been working on a PHP4 module, called securesocket, that wraps several of the OpenSSL routines. So far, there's about 75 routines in my module, covering essentially all of the basic routines required to perform SSL connections (support for client-oriented routines is slightly more advanced than for servers). At present there is support for connecting to a server, verifying certificates (partially), reading, writing, buffered BIOs and getting/setting SSL operating modes. My module is starting to get to the point where it is mature enough for me to consider releasing it (although it's still in a very rudimentary form). Is anyone interested in having a look at what I've done? At present I don't have access to my own publicly-accessible server. If anyone is interested in helping me host this, ideally as part of a collaborative effort using CVS, then please contact me. Best Wishes, David Gillies San Jose Costa Rica P.S. A minimal SSL session with my module might look something like the following: $ctx=securesocket_ssl_ctx_new(securesocket_sslv3_client_method()); $ssl=securesocket_ssl_new($ctx); $sock=securesocket_connect_to_host(localhost,443); securesocket_ssl_set_fd($ssl,$sock,BIO_NOCLOSE); securesocket_ssl_connect($ssl); $peer=securesocket_ssl_get_peer_certificate($ssl); $getstr=GET / HTTP/1.0\r\n\r\n; securesocket_ssl_write($ssl,$getstr,strlen($getstr)); $bytes=securesocket_ssl_read($ssl,$repstr,1024); securesocket_ssl_shutdown($ssl); securesocket_ssl_free($ssl); securesocket_ssl_ctx_free($ctx); __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Capturing headers with output buffering?
Hi: Architecturally speaking, is there any simple way to modify an sapi backend to return HTTP headers through the output buffering mechanism? As far as I can tell, headers are managed seperately by main/output.c, with php_ub_body_write_no_header being substituted in once the HTTP headers are sent. Pointers to anything would be greatly appreciated. TIA, - Dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Capturing headers with output buffering?
Hi George: It's something that's probably better solved in user-space, but I figured I'd poke around anyway. :) I'm attempting to write a little prefork HTTP server entirely in PHP. The script instansiates an 'application class', which is persistent across requests. Output of the application is captured with an ob_* callback function, and then stuffed down a socket. I'm hoping for free in-memory opcode caching and database connection persistence (by virtue of recycling the same interpreter across multiple requests), and possibly the elimination of a lot of application-specific startup time. Of course, this whole thing could very well just be a bad idea. :) Anyway, headers aren't currently included in the buffered output, which causes the header() function to print to stdout, effectively doing nothing. I could just wrap header() with a user-space function, but that would prevent a lot of scripts from running as-is. Bad idea? Maybe. There's also the matter of getting it to parse POST/GET without completely reinventing the wheel... - Dave On Sun, Nov 24, 2002 at 05:57:33PM -0500, George Schlossnagle wrote: | What are you trying to accomplish? | | | On Sunday, November 24, 2002, at 05:40 PM, David Brown wrote: | | Hi: | | Architecturally speaking, is there any simple way to modify an sapi | backend to return HTTP headers through the output buffering mechanism? | | As far as I can tell, headers are managed seperately by main/output.c, | with php_ub_body_write_no_header being substituted in once the HTTP | headers are sent. | | Pointers to anything would be greatly appreciated. | | TIA, | - Dave | | | -- | 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] Proto void and return values...
On Tue, Nov 12, 2002 at 02:16:41PM -0500, David Brown wrote: | Hi everyone: | | For functions prototyped as returning void, return values seem to be applied | at random. Some functions, such as trigger_error/user_error, srand, ob_start, | and phpinfo, use RETURN_TRUE. The vast majority of these functions just fall | through, implicitly returning NULL to userland. Or perhaps I'v just thought about this entirely too long. Is it possible that the prototypes are just wrong in the documentation? Regards, - Dave [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Do I need the closing ? tag
PHP 4.2.2 (linux) doesn't seem to mind if I leave off the closing ? tag at the end of a file. Is the ? assumed at EOF? I have PHP that outputs binary and along the way I include() a lot of php scripts. I'm constantly having problems when I leave a little whitespace at the end of some script after the ? which screws up the output binary. First time this happened it took me hours to figure out the cause. What does everyone think about just leaving off the ? as a solution to this? It works for me now, but would any PHP developer care to prognosticate on the liklihood this might change in future? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] MySQL UDF that runs PHP
Indeed, that would be cool. -dave -Original Message- From: Adam Voigt [mailto:adam;cryptocomm.com] Sent: Wednesday, November 06, 2002 1:05 PM To: David Sklar Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DEV] MySQL UDF that runs PHP I'm very intrigued, this looks pretty cool. I don't suppose there's anyway you could link in the connectivity to the MySQL engine so you didn't have to have the same connection overhead as external mysql connections from standard PHP pages? Cause that would just be sweet. Adam Voigt [EMAIL PROTECTED] On Tue, 2002-11-05 at 16:37, David Sklar wrote: Based on Edin Kadribasic's PHP embed SAPI module, I wrote a MySQL UDF that interprets PHP. You can get it here: -- http://www.sklar.com/myphp-0.1.tar.gz I'd be curious for any comments or suggestions folks have. Thanks, David Sklar -- 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
[PHP-DEV] MySQL UDF that runs PHP
Based on Edin Kadribasic's PHP embed SAPI module, I wrote a MySQL UDF that interprets PHP. You can get it here: -- http://www.sklar.com/myphp-0.1.tar.gz I'd be curious for any comments or suggestions folks have. Thanks, David Sklar -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] php/ext/xslt and TSRM
perhaps i'm a bit slow... what is the gain by moving the TSRMLS_FETCH() from functions to having the TSRM params in the php_xslt struct? that is, what functionality or benefit is brought to the extension or the code? Is there something that the extension does not handle properly as it stands? or is the idea simply to remove lots of TSRMLS_FETCH() calls? btw - we should move this discussion from php-dev to sab-php. that's where we're trying to maintain all php/sablotron maintanence issues. dave -Original Message- From: Marcus Boerger [mailto:marcus.boerger;t-online.de] Sent: Wednesday, October 30, 2002 7:38 AM To: Melvyn Sopacua Cc: Sterling Hughes; [EMAIL PROTECTED]; David Viner Subject: Re: [PHP-DEV] php/ext/xslt and TSRM At 15:54 30.10.2002, Melvyn Sopacua wrote: At 15:10 30-10-2002, Marcus Boerger wrote: What about removing all TSRMLS_FETCH() and instead passing TSRM parameters in php_xslt struct? Before you do that, I'd rather you wait untill after the weekend - unless there's a compelling reason not too. I'm working on exposure of Sablotron SXP_ functions, and this may alter quite a few things in the files. A complete overhaul of the thread issues is then welcome, but I think David is capable of this also. When it shall be done by me tell me when i can proceed. I suggest a diff to check before comitting would be the way to go with this issue. marcus With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] berkeley db and dba
Hi, I noticed that the ext/dba extension allows me to use Berkeley DB. I'm interested in using some of the newer features in Berkeley DB v4 (sleepycat's latest release). In particular, there are a set of features regarding a db environment. See http://www.sleepycat.com/docs/ref/env/intro.html for more information if you're interested. Basically the things that really attract me to this are the memory pools that might allow multiple apache processes to use shared memory (file-backed or system memory) for caching data. But the dba extension doesn't seem to provide any hooks for these calls, or other db-specific functions. What is the best way for me to get access to these functions? thanks dave viner -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Unsigned Problems Revisited
On Thu, 24 Oct 2002, Andi Gutmans wrote: At 02:49 PM 10/23/2002 -0500, David M. Lloyd wrote: The reality of twos-complement, bitwise arithmatic is that there are three basic shift operations: shift left, bitwise shift right, and arithmetic shift right. This simple fact is one of the basic ideas of dealing with twos-complement integers. I know that but I still wanted the opposite to be available to keep things symmetrical. I'm not sure but I think CPU's do support both logical and arithmetic shifts and just do the same with both (I might be wrong though). Generally no, it's a waste of opcode space for modern CISC processors. RISC processors often have integrated barrel-shifters, so they don't need shift instructions at all. Intel carries over arithmetic shift right instructions from older architetures for backwards-compatibility with x86, but their RISC implementation (Itanium) does not contain support for the operation. One RISC example is ARM. They give you four shift options: Logical left, logical right, arithmetic right, and rotate right. Making the operation symmetrical is a waste of precious bit combinations, and would have meant either losing another shift operation or else adding another bit to the shift operation specifier, which means that another bit would have to be sacrificed elsewhere. Another example is SPARC, which implements shifting with discrete instructions, only implents one left shift operator. PowerPC does not implement it either. Given this fact, there is no reason to have a bogus fourth operator in the name of symmetry. Mathematical operaters are simply not always symmetrical. There is no such thing as 'arithmetic shift left' or 'logical shift left' in terms of twos-complement integers, so why invent it? I agree that they don't *have* to be symmetrical but I think it's better. Better why? Anyone who understands twos-complement will understand (and expect) the ability to do those three operations, and will not be surprised by the lack of two left shifts. I argue that they *should NOT* be symmetrical because it is wrong. Second of all, my understanding of the here-doc operator is that it acts as a unary operation. I don't see the conflict with the binary application of , given the example of unary and binary -, if it is absolutely neccessary to fulfill the (somewhat psychotic) need for symmetry where it is not realy needed, or even strictly correct. psychotic? Can we please have discussions on a professional and not personal level? It is true though, unless you can give me a sound mathematical reason that the ops should exist... and saying it looks right or it is easier is not a valid reason, becuase to those with even basic twos-complement math background, it looks wrong and is not easier. As far as I remember it does clash with here-docs. I'm pretty sure I thought of an example a while back. I can try and think of one again. In any case, I wouldn't want an overloaded operator. We try and keep away of that kind of stuff with PHP. Very well... then let's not put in the nonsense operator, and just have three shift operations: , , and . - D [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Unsigned Problems Revisited
On Tue, 22 Oct 2002, Andi Gutmans wrote: Jason knows that my stand on this one is that if we have we really should also have which will clash with here-docs. Suggestions for other operators such as his are a possibility. Wrong on two counts. The reality of twos-complement, bitwise arithmatic is that there are three basic shift operations: shift left, bitwise shift right, and arithmetic shift right. This simple fact is one of the basic ideas of dealing with twos-complement integers. Given this fact, there is no reason to have a bogus fourth operator in the name of symmetry. Mathematical operaters are simply not always symmetrical. There is no such thing as 'arithmetic shift left' or 'logical shift left' in terms of twos-complement integers, so why invent it? Second of all, my understanding of the here-doc operator is that it acts as a unary operation. I don't see the conflict with the binary application of , given the example of unary and binary -, if it is absolutely neccessary to fulfill the (somewhat psychotic) need for symmetry where it is not realy needed, or even strictly correct. - D [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Problem with XSLT Sablotron - Bug ?
does this work from the sablotron command line? you should be able to run sabcmd test.xslt test.xml and see the correct output. If this fails, then the problem has nothing to do with PHP. If this succeeds, then the error lies with the php extension. I'm cc-ing sab-php list which has assumed ownership of PHP's xslt extension. We should remove php-dev from this list for the time being. dave -Original Message- From: Dirk Schwier [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:24 PM To: [EMAIL PROTECTED] Subject: [PHP-DEV] Problem with XSLT Sablotron - Bug ? Hy NG, I get under some circumstances an Sablotron Error: XML parser error 3: no element found - this Error occurs only, when I put a lot of Text into an CDATA-Section. I Put a sample script beyond, maybe somone can tell me, if there is a wokaround or if it is a bug (this is, what I guess). I tried different php versions (4.2.3, 4.3.0dev, 4.3.0.-pre1, etc.) at the moment I use Sablotron 0.96.1. These are the sample scripts: An XML-Datei (test.xml) ?xml version=1.0 encoding=iso-8859-1? !DOCTYPE navigation [ !ENTITY module1 SYSTEM test2.xml ] navigation module1; /navigation and test2.xml. the entity: ?xml version=1.0 encoding=iso-8859-1? test ![CDATA[ sdfgsdfgjsödfkjgsödlkfjgsödkfjgsödfkgjsödkfgjsödkfgjsödkfgjsödlkfjgsödfgsdfg gslkdjfgsödlkfjgöslkdjgösldkgjsödlkfgjsödklfgjsödlkfgjsödkfgjsöd flkgjsödkfgjsödklfgjsödlkfgjsödlkfgjsödlkfgjsödlkfgjsödlkfgjsödklfgjösdklfgj södklfgjsödklfgjsödkfgjösdkfgjsödfkgjsödfkgjsödfkgjsödfgsdfgsjdöfgksjödfkgjs ödlfkgjsödlkfjgsödlkfgjsödkfjgösdklfgjösdkfjgösdkfgjösdlkfgjsödlkfgjsödlkfjg öskldfgjöslkjgölkwejrtkwejrtwejrtkjweörkltjweörkltjwöekrtjwöerlktjwöerkltjwö ekrltjwöelkrtjwöeklrjtwöelkrtjweölrktjwöelrktjwöelkrjtwöekrtjwöekrjtöwerktjw öerkjtöweklrtjwkerjtöwkerjtöwlkerjtöwklerjtöwlkerjtöweklrjtöwklerjtöwekrtjöw elkrtjöwkelrjtöwkerjtöwlkerjtöweklrtjöweklrjtöwekrjtöwerktjwöekrtjwöekrjtöwe lkrjtwöekrtjöwekrtjöwelkrjtwökelrtöwekrtjöwkelrjtölwkerjtwlökerjtwölekrjtwöl ekrjtlwöekrjtlwöekrjlketjlkjklrjlkjkjrkjlkröjlkrjklrejlkrejlkrtjlktrjlktrkjl trjlktrkljkltrjlktrjkltrkjlötrewrjlkewjlkrewjklrejlktrwkjlrkjlörwejklörewjkl trjöewrjlökerkwrelökwrjkleöw [... snipp ca. 240 columns with same content ...] ]] /test (for the test you have to the 240 cols into the script ...) and test.xslt: [... snipp ...] xsl:template match=navigation xsl:value-of select=./ /xsl:template [... snipp ...] this is the parsing script (test.php): if( !$result = @xslt_process( $parser, // resource xh test.xml, // string xml test.xslt, // string xslt $html, // string result array(), // array arguments array() // array parameters ) ) { printf( Sablotron Error (%s): br /strong%s/strong, xslt_errno($parser), xslt_error($parser) ); } xslt_free($parser); echo $result; echo $html; after that I get the error. If I delete some content in the test2.xml I get no error. So I hope, that someone can help me. :) Dirk Schwier. -- 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] Re: output buffering
Agreed, it's only common courtesy. david Zeev Suraski wrote: The least you should do is ask either Sascha or me how come it uses chunked buffering, and whether it's not a bug. You would have gotten a pretty clear response saying that it fully supports chunked buffering. No. I don't think I need to ask. Sometimes you do. If you are touching other peoples' code, and especially if that code is rather critical you need to make really damn sure you know what you are doing before you change it. A quick summary of what you have in mind sent to php-dev and/or the author(s) of the code in question is all it takes. It doesn't take very long and it is common courtesy if nothing else. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Segafults...
FWIW, I'm still seeing the segfaults on beos for session code. I'm away until Thursday evening now, but if someone can give some ideas then I'll try to trace it further when I get back... The segafults occur in _object_and_properties_init. _object_and_properties_init _object_init_ex php_var_unserialize ps_srlzr_decode_php php_session_decode php_session_initialize ext/session/tests/003.phpt is the first test to trigger this :( david -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] session tests segfaulting...
I'm getting a segfault on the following tests in ext/session... 3,7,8,9,12,13,14,18,19 21 Test 15 also fails. The system is BeOS. BeOS tends to be more conservative about memory than some systems and will segfault for errors where other systems carry on (which is a PITA!) I'll provide any help I can but last time I traced it it looked like PHP_IC_ENTRY was being set as NULL... david -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] using run-tests.php on windows
hi, i'm trying to get the php tests to run on my windows 2k machine, and having a lot of trouble. i seem to fail at this line: if (!is_executable($php)) { error(invalid PHP executable specified by TEST_PHP_EXECUTABLE = . $php); } I removed the '' to see what was happening, and I get this error message: PHP Fatal error: Call to undefined function: is_executable() I just checked out the latest tree, and recompiled everything, and it all compiled without an error. Here's the full output: D:\php\php4release_ts\php.exe run-tests.php PHP Fatal error: Call to undefined function: is_executable() in D:\php\php4\ru n-tests.php on line 77 Fatal error: Call to undefined function: is_executable() in D:\php\php4\run-tes ts.php on line 77 I'm sure I'm just missed a step somewhere, but I can't seem to figure out what I've done wrong. (Also, I tried using the MSVC++ testsuite workspace, but again without success. that error message said: Configuration: testsuite - Win32 Release_TS Build : warning : failed to (or don't know how to) build 'D:\php\php4\results.txt' Running Testsuite, please wait... Error executing c:\winnt\system32\cmd.exe. testsuite - 1 error(s), 1 warning(s) ) Does anyone else have this problem? or does anyone have success building the tests from Windows? thanks dave viner -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] PHP_IC_ENTRY
When I run make test the session tests fail (almost all of them) and it seems after some tracing that PHP_IC_ENTRY is always NULL and for the sessions so it dies when running object_common1 from php_var_unserialize. This first occurs in 003.phpt. Anyone care to throw pointers about what's going on? This is CVS head on beos if it makes any difference. david -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] [PATCH] ext/xslt - xslt_set_object
after talking with other xslt developers, and ensuring backwards compatibility, I have commited this change to the ext/xslt extension. dave -Original Message- From: David Viner [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 03, 2002 11:00 AM To: Php-Dev@lists. php. net Subject: [PHP-DEV] [PATCH] ext/xslt - xslt_set_object Here's a short patch to the XSLT extension that allows a user to call xslt_set_object($xh,$obj); This works in a manner similar to the 'xml_set_object' function. (Only difference is that the second argument is not passed by reference.) dave = BEGIN PATCH = Index: ext/xslt/php_sablot.h === RCS file: /repository/php4/ext/xslt/php_sablot.h,v retrieving revision 1.11 diff -B -b -u -r1.11 php_sablot.h --- ext/xslt/php_sablot.h 22 Aug 2002 09:54:04 - 1.11 +++ ext/xslt/php_sablot.h 3 Oct 2002 17:57:27 - @@ -62,6 +62,7 @@ PHP_FUNCTION(xslt_error); PHP_FUNCTION(xslt_errno); PHP_FUNCTION(xslt_free); +PHP_FUNCTION(xslt_set_object); PHP_FUNCTION(xslt_backend_version); PHP_FUNCTION(xslt_backend_name); @@ -112,6 +114,7 @@ struct xslt_handlers *handlers; struct xslt_processor processor; struct xslt_error *err; + zval *object; } php_xslt; #else Index: ext/xslt/php_xslt.h === RCS file: /repository/php4/ext/xslt/php_xslt.h,v retrieving revision 1.9 diff -B -b -u -r1.9 php_xslt.h --- ext/xslt/php_xslt.h 28 Feb 2002 08:27:00 - 1.9 +++ ext/xslt/php_xslt.h 3 Oct 2002 17:57:27 - @@ -51,7 +51,7 @@ extern void xslt_assign_handler(struct xslt_function **, zval **); extern void xslt_free_handler(struct xslt_function *); -extern void xslt_call_function(char *, zval *, int, zval **, zval **); +extern void xslt_call_function(char *, zval *, zval *, int, zval **, zval **); extern void xslt_debug(char *, char *, ...); Index: ext/xslt/sablot.c === RCS file: /repository/php4/ext/xslt/sablot.c,v retrieving revision 1.52 diff -B -b -u -r1.52 sablot.c --- ext/xslt/sablot.c 22 Aug 2002 09:54:04 - 1.52 +++ ext/xslt/sablot.c 3 Oct 2002 17:57:27 - @@ -87,6 +88,7 @@ PHP_FE(xslt_error, NULL) PHP_FE(xslt_errno, NULL) PHP_FE(xslt_free,NULL) + PHP_FE(xslt_set_object, NULL) PHP_FE(xslt_backend_version, NULL) PHP_FE(xslt_backend_name,NULL) {NULL, NULL, NULL} @@ -182,6 +184,7 @@ handle = ecalloc(1, sizeof(php_xslt)); handle-handlers = ecalloc(1, sizeof(struct xslt_handlers)); handle-err = ecalloc(1, sizeof(struct xslt_error)); + handle-object = NULL; XSLT_LOG(handle).path = NULL; @@ -610,6 +613,32 @@ } /* }}} */ +/* {{{ proto void xslt_set_object(resource parser, object obj) + sets the object in which to resolve callback functions */ +PHP_FUNCTION(xslt_set_object) +{ + zval **processor_p; /* Resource pointer to a PHP-XSLT processor */ + zval **myobj;/* The object that will handle the callback */ + php_xslt *handle; /* A PHP-XSLT processor */ + + if (ZEND_NUM_ARGS() != 2 || + zend_get_parameters_ex(2, processor_p, myobj) == FAILURE) { + WRONG_PARAM_COUNT; + } + /* make sure the second argument is an object */ + if (Z_TYPE_PP(myobj) != IS_OBJECT) { + php_error(E_WARNING,arg 2 has wrong type); + RETURN_FALSE; + } + + ZEND_FETCH_RESOURCE(handle, php_xslt *, processor_p, -1, le_xslt_name, le_xslt); + + handle-object = *myobj; + + RETURN_TRUE; +} +/* }}} */ + /* {{{ proto void xslt_backend_version() Returns the version number of Sablotron (if available) */ PHP_FUNCTION(xslt_backend_version) @@ -742,7 +771,7 @@ ZVAL_STRING(argv[1], (char *) scheme, 1); ZVAL_STRING(argv[2], (char *) rest, 1); - xslt_call_function(scheme get all, XSLT_SCHEME(handle).get_all, + xslt_call_function(scheme get all, XSLT_SCHEME(handle).get_all, handle-object, 3, argv, retval); /* Save the return value in the buffer (copying it) */ @@ -820,7 +849,7 @@ ZVAL_STRING(argv[2], (char *) rest, 1); /* Call the function */ - xslt_call_function(scheme open, XSLT_SCHEME(handle).open, + xslt_call_function(scheme open, XSLT_SCHEME(handle).open, handle-object, 3, argv, retval); /* Return value is a resource pointer to an open file */ @@ -864,7 +893,7 @@ ZVAL_STRINGL(argv[2], buffer, *byte_count, 0); /* Call the function */ - xslt_call_function(scheme get, XSLT_SCHEME(handle).get, + xslt_call_function(scheme get
[PHP-DEV] [PATCH] ext/xslt - xslt_set_object
Here's a short patch to the XSLT extension that allows a user to call xslt_set_object($xh,$obj); This works in a manner similar to the 'xml_set_object' function. (Only difference is that the second argument is not passed by reference.) dave = BEGIN PATCH = Index: ext/xslt/php_sablot.h === RCS file: /repository/php4/ext/xslt/php_sablot.h,v retrieving revision 1.11 diff -B -b -u -r1.11 php_sablot.h --- ext/xslt/php_sablot.h 22 Aug 2002 09:54:04 - 1.11 +++ ext/xslt/php_sablot.h 3 Oct 2002 17:57:27 - -62,6 +62,7 PHP_FUNCTION(xslt_error); PHP_FUNCTION(xslt_errno); PHP_FUNCTION(xslt_free); +PHP_FUNCTION(xslt_set_object); PHP_FUNCTION(xslt_backend_version); PHP_FUNCTION(xslt_backend_name); -112,6 +114,7 struct xslt_handlers *handlers; struct xslt_processor processor; struct xslt_error *err; + zval *object; } php_xslt; #else Index: ext/xslt/php_xslt.h === RCS file: /repository/php4/ext/xslt/php_xslt.h,v retrieving revision 1.9 diff -B -b -u -r1.9 php_xslt.h --- ext/xslt/php_xslt.h 28 Feb 2002 08:27:00 - 1.9 +++ ext/xslt/php_xslt.h 3 Oct 2002 17:57:27 - -51,7 +51,7 extern void xslt_assign_handler(struct xslt_function **, zval **); extern void xslt_free_handler(struct xslt_function *); -extern void xslt_call_function(char *, zval *, int, zval **, zval **); +extern void xslt_call_function(char *, zval *, zval *, int, zval **, zval **); extern void xslt_debug(char *, char *, ...); Index: ext/xslt/sablot.c === RCS file: /repository/php4/ext/xslt/sablot.c,v retrieving revision 1.52 diff -B -b -u -r1.52 sablot.c --- ext/xslt/sablot.c 22 Aug 2002 09:54:04 - 1.52 +++ ext/xslt/sablot.c 3 Oct 2002 17:57:27 - -87,6 +88,7 PHP_FE(xslt_error, NULL) PHP_FE(xslt_errno, NULL) PHP_FE(xslt_free,NULL) + PHP_FE(xslt_set_object, NULL) PHP_FE(xslt_backend_version, NULL) PHP_FE(xslt_backend_name,NULL) {NULL, NULL, NULL} -182,6 +184,7 handle = ecalloc(1, sizeof(php_xslt)); handle-handlers = ecalloc(1, sizeof(struct xslt_handlers)); handle-err = ecalloc(1, sizeof(struct xslt_error)); + handle-object = NULL; XSLT_LOG(handle).path = NULL; -610,6 +613,32 } /* }}} */ +/* {{{ proto void xslt_set_object(resource parser, object obj) + sets the object in which to resolve callback functions */ +PHP_FUNCTION(xslt_set_object) +{ + zval **processor_p; /* Resource pointer to a PHP-XSLT processor */ + zval **myobj;/* The object that will handle the callback */ + php_xslt *handle; /* A PHP-XSLT processor */ + + if (ZEND_NUM_ARGS() != 2 || + zend_get_parameters_ex(2, processor_p, myobj) == FAILURE) { + WRONG_PARAM_COUNT; + } + /* make sure the second argument is an object */ + if (Z_TYPE_PP(myobj) != IS_OBJECT) { + php_error(E_WARNING,arg 2 has wrong type); + RETURN_FALSE; + } + + ZEND_FETCH_RESOURCE(handle, php_xslt *, processor_p, -1, le_xslt_name, le_xslt); + + handle-object = *myobj; + + RETURN_TRUE; +} +/* }}} */ + /* {{{ proto void xslt_backend_version() Returns the version number of Sablotron (if available) */ PHP_FUNCTION(xslt_backend_version) -742,7 +771,7 ZVAL_STRING(argv[1], (char *) scheme, 1); ZVAL_STRING(argv[2], (char *) rest, 1); - xslt_call_function(scheme get all, XSLT_SCHEME(handle).get_all, + xslt_call_function(scheme get all, XSLT_SCHEME(handle).get_all, handle-object, 3, argv, retval); /* Save the return value in the buffer (copying it) */ -820,7 +849,7 ZVAL_STRING(argv[2], (char *) rest, 1); /* Call the function */ - xslt_call_function(scheme open, XSLT_SCHEME(handle).open, + xslt_call_function(scheme open, XSLT_SCHEME(handle).open, handle-object, 3, argv, retval); /* Return value is a resource pointer to an open file */ -864,7 +893,7 ZVAL_STRINGL(argv[2], buffer, *byte_count, 0); /* Call the function */ - xslt_call_function(scheme get, XSLT_SCHEME(handle).get, + xslt_call_function(scheme get, XSLT_SCHEME(handle).get, handle-object, 3, argv, retval); /* Returns the number of bytes read */ -908,7 +937,7 ZVAL_STRINGL(argv[2], (char *) buffer, *byte_count, 1); /* Call the scheme put function already */ - xslt_call_function(scheme put, XSLT_SCHEME(handle).put, + xslt_call_function(scheme put,
RE: [PHP-DEV] [PATCH] ext/xslt - xslt_set_object
resending as an attachment. dave -Original Message- From: David Viner [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 03, 2002 11:00 AM To: Php-Dev@lists. php. net Subject: [PHP-DEV] [PATCH] ext/xslt - xslt_set_object Here's a short patch to the XSLT extension that allows a user to call xslt_set_object($xh,$obj); This works in a manner similar to the 'xml_set_object' function. (Only difference is that the second argument is not passed by reference.) dave = BEGIN PATCH = Index: ext/xslt/php_sablot.h === RCS file: /repository/php4/ext/xslt/php_sablot.h,v retrieving revision 1.11 diff -B -b -u -r1.11 php_sablot.h --- ext/xslt/php_sablot.h 22 Aug 2002 09:54:04 - 1.11 +++ ext/xslt/php_sablot.h 3 Oct 2002 17:57:27 - @@ -62,6 +62,7 @@ PHP_FUNCTION(xslt_error); PHP_FUNCTION(xslt_errno); PHP_FUNCTION(xslt_free); +PHP_FUNCTION(xslt_set_object); PHP_FUNCTION(xslt_backend_version); PHP_FUNCTION(xslt_backend_name); @@ -112,6 +114,7 @@ struct xslt_handlers *handlers; struct xslt_processor processor; struct xslt_error *err; + zval *object; } php_xslt; #else Index: ext/xslt/php_xslt.h === RCS file: /repository/php4/ext/xslt/php_xslt.h,v retrieving revision 1.9 diff -B -b -u -r1.9 php_xslt.h --- ext/xslt/php_xslt.h 28 Feb 2002 08:27:00 - 1.9 +++ ext/xslt/php_xslt.h 3 Oct 2002 17:57:27 - @@ -51,7 +51,7 @@ extern void xslt_assign_handler(struct xslt_function **, zval **); extern void xslt_free_handler(struct xslt_function *); -extern void xslt_call_function(char *, zval *, int, zval **, zval **); +extern void xslt_call_function(char *, zval *, zval *, int, zval **, zval **); extern void xslt_debug(char *, char *, ...); Index: ext/xslt/sablot.c === RCS file: /repository/php4/ext/xslt/sablot.c,v retrieving revision 1.52 diff -B -b -u -r1.52 sablot.c --- ext/xslt/sablot.c 22 Aug 2002 09:54:04 - 1.52 +++ ext/xslt/sablot.c 3 Oct 2002 17:57:27 - @@ -87,6 +88,7 @@ PHP_FE(xslt_error, NULL) PHP_FE(xslt_errno, NULL) PHP_FE(xslt_free,NULL) + PHP_FE(xslt_set_object, NULL) PHP_FE(xslt_backend_version, NULL) PHP_FE(xslt_backend_name,NULL) {NULL, NULL, NULL} @@ -182,6 +184,7 @@ handle = ecalloc(1, sizeof(php_xslt)); handle-handlers = ecalloc(1, sizeof(struct xslt_handlers)); handle-err = ecalloc(1, sizeof(struct xslt_error)); + handle-object = NULL; XSLT_LOG(handle).path = NULL; @@ -610,6 +613,32 @@ } /* }}} */ +/* {{{ proto void xslt_set_object(resource parser, object obj) + sets the object in which to resolve callback functions */ +PHP_FUNCTION(xslt_set_object) +{ + zval **processor_p; /* Resource pointer to a PHP-XSLT processor */ + zval **myobj;/* The object that will handle the callback */ + php_xslt *handle; /* A PHP-XSLT processor */ + + if (ZEND_NUM_ARGS() != 2 || + zend_get_parameters_ex(2, processor_p, myobj) == FAILURE) { + WRONG_PARAM_COUNT; + } + /* make sure the second argument is an object */ + if (Z_TYPE_PP(myobj) != IS_OBJECT) { + php_error(E_WARNING,arg 2 has wrong type); + RETURN_FALSE; + } + + ZEND_FETCH_RESOURCE(handle, php_xslt *, processor_p, -1, le_xslt_name, le_xslt); + + handle-object = *myobj; + + RETURN_TRUE; +} +/* }}} */ + /* {{{ proto void xslt_backend_version() Returns the version number of Sablotron (if available) */ PHP_FUNCTION(xslt_backend_version) @@ -742,7 +771,7 @@ ZVAL_STRING(argv[1], (char *) scheme, 1); ZVAL_STRING(argv[2], (char *) rest, 1); - xslt_call_function(scheme get all, XSLT_SCHEME(handle).get_all, + xslt_call_function(scheme get all, XSLT_SCHEME(handle).get_all, handle-object, 3, argv, retval); /* Save the return value in the buffer (copying it) */ @@ -820,7 +849,7 @@ ZVAL_STRING(argv[2], (char *) rest, 1); /* Call the function */ - xslt_call_function(scheme open, XSLT_SCHEME(handle).open, + xslt_call_function(scheme open, XSLT_SCHEME(handle).open, handle-object, 3, argv, retval); /* Return value is a resource pointer to an open file */ @@ -864,7 +893,7 @@ ZVAL_STRINGL(argv[2], buffer, *byte_count, 0); /* Call the function */ - xslt_call_function(scheme get, XSLT_SCHEME(handle).get, + xslt_call_function(scheme get, XSLT_SCHEME(handle).get, handle-object, 3, argv, retval); /* Returns the number
Re: [PHP-DEV] PHP_AUTH_USER in 4.3
This also seems to be a problem for SquirrelMail (2.0.8) which just hangs after the upgrade. It was working OK before I changed to CVS. david - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: David Reid [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 1:29 AM Subject: Re: [PHP-DEV] PHP_AUTH_USER in 4.3 It shouldn't have stopped working. Did you change your register_globals setting or something? On Wed, 2 Oct 2002, David Reid wrote: Is support for this being dropped or is it just not added yet? Just changed from 4.2.3 and was surprised to see that it stopped working... david -- 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] TSRM patch for BeOS
Any chance of committing this patch. Adds support for beos threading to TSRM and some small corrections for virtual_cwd. Thanks. david Using port 2401 Index: TSRM/TSRM.c === RCS file: /repository/TSRM/TSRM.c,v retrieving revision 1.44 diff -u -r1.44 TSRM.c --- TSRM/TSRM.c 7 Aug 2002 14:47:05 - 1.44 +++ TSRM/TSRM.c 2 Oct 2002 23:57:12 - -95,9 +95,10 static int tls_key; #elif defined(TSRM_WIN32) static DWORD tls_key; +#elif defined(BETHREADS) +static int32 tls_key; #endif - /* Startup TSRM (call once for the entire process) */ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename) { -110,6 +111,8 st_key_create(tls_key, 0); #elif defined(TSRM_WIN32) tls_key = TlsAlloc(); +#elif defined(BETHREADS) +tls_key = tls_allocate(); #endif tsrm_error_file = stderr; -258,6 +261,8 st_thread_setspecific(tls_key, (void *) *thread_resources_ptr); #elif defined(TSRM_WIN32) TlsSetValue(tls_key, (void *) *thread_resources_ptr); +#elif defined(BETHREADS) +tls_set(tls_key, (void*) *thread_resources_ptr); #endif if (tsrm_new_thread_begin_handler) { -297,6 +302,8 thread_resources = st_thread_getspecific(tls_key); #elif defined(TSRM_WIN32) thread_resources = TlsGetValue(tls_key); +#elif defined(BETHREADS) +thread_resources = (tsrm_tls_entry*)tls_get(tls_key); #else thread_resources = NULL; #endif -423,6 +430,8 return PIThread_getCurrent(); #elif defined(TSRM_ST) return st_thread_self(); +#elif defined(BETHREADS) + return find_thread(NULL); #endif } -454,6 +463,10 mutexp = PIPlatform_allocLocalMutex(); #elif defined(TSRM_ST) mutexp = st_mutex_new(); +#elif defined(BETHREADS) + mutexp = (beos_ben*)malloc(sizeof(beos_ben)); + mutexp-ben = 0; + mutexp-sem = create_sem(1, PHP sempahore); #endif #ifdef THR_DEBUG printf(Mutex created thread: %d\n,mythreadid()); -481,6 +494,9 PISync_delete(mutexp); #elif defined(TSRM_ST) st_mutex_destroy(mutexp); +#elif defined(BETHREADS) + delete_sem(mutexp-sem); + free(mutexp); #endif } #ifdef THR_DEBUG -508,6 +524,10 return PISync_lock(mutexp); #elif defined(TSRM_ST) return st_mutex_lock(mutexp); +#elif defined(BETHREADS) + if (atomic_add(mutexp-ben, 1) != 0) + return acquire_sem(mutexp-sem); +return 0; #endif } -531,6 +551,10 return PISync_unlock(mutexp); #elif defined(TSRM_ST) return st_mutex_unlock(mutexp); +#elif defined(BETHREADS) +if (atomic_add(mutexp-ben, -1) != 1) + return release_sem(mutexp-sem); + return 0; #endif } Index: TSRM/TSRM.h === RCS file: /repository/TSRM/TSRM.h,v retrieving revision 1.35 diff -u -r1.35 TSRM.h --- TSRM/TSRM.h 7 Aug 2002 14:47:05 - 1.35 +++ TSRM/TSRM.h 2 Oct 2002 23:57:12 - -47,6 +47,9 # include pthread.h #elif defined(TSRM_ST) # include st.h +#elif defined(BETHREADS) +#include kernel/OS.h +#include TLS.h #endif typedef int ts_rsrc_id; -73,6 +76,13 #elif defined(TSRM_ST) # define THREAD_T st_thread_t # define MUTEX_T st_mutex_t +#elif defined(BETHREADS) +# define THREAD_T thread_id +typedef struct { + sem_id sem; + int32 ben; +} beos_ben; +# define MUTEX_T beos_ben * #endif typedef void (*ts_allocate_ctor)(void *, void ***); Index: TSRM/threads.m4 === RCS file: /repository/TSRM/threads.m4,v retrieving revision 1.11 diff -u -r1.11 threads.m4 --- TSRM/threads.m4 19 Sep 2001 09:01:05 - 1.11 +++ TSRM/threads.m4 2 Oct 2002 23:57:12 - -102,26 +102,31 dnl AC_DEFUN(PTHREADS_CHECK,[ -save_CFLAGS=$CFLAGS -save_LIBS=$LIBS -PTHREADS_ASSIGN_VARS -PTHREADS_CHECK_COMPILE -LIBS=$save_LIBS -CFLAGS=$save_CFLAGS +if test $beos_threads = 1; then + pthreads_working=yes + ac_cv_pthreads_cflags= +else + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + PTHREADS_ASSIGN_VARS + PTHREADS_CHECK_COMPILE + LIBS=$save_LIBS + CFLAGS=$save_CFLAGS -AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ -ac_cv_pthreads_cflags= -if test $pthreads_working != yes; then - for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do -ac_save=$CFLAGS -CFLAGS=$CFLAGS $flag -PTHREADS_CHECK_COMPILE -CFLAGS=$ac_save -if test $pthreads_working = yes; then - ac_cv_pthreads_cflags=$flag - break -fi - done + AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ + ac_cv_pthreads_cflags= + if test $pthreads_working != yes; then +for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do + ac_save=$CFLAGS + CFLAGS=$CFLAGS $flag + PTHREADS_CHECK_COMPILE + CFLAGS=$ac_save + if test $pthreads_working = yes; then +ac_cv_pthreads_cflags=$flag +break + fi +done + fi fi ]) Index: TSRM/tsrm.m4
[PHP-DEV] apache2filter error...
This is a new error I just started seeing... /boot/home/php4/sapi/apache2filter/php_functions.c: In function `php_apache_lookup_uri': /boot/home/php4/sapi/apache2filter/php_functions.c:46: error: `tsrm_ls' undeclared (first use in this function) /boot/home/php4/sapi/apache2filter/php_functions.c:46: error: (Each undeclared identifier is reported only once /boot/home/php4/sapi/apache2filter/php_functions.c:46: error: for each function it appears in.) Any ideas? david -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] PHP_AUTH_USER in 4.3
Is support for this being dropped or is it just not added yet? Just changed from 4.2.3 and was surprised to see that it stopped working... david -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: dviner
Developing the PHP runtime, as per Rasmus' suggestion. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] [PATCH] include statement in php.ini file
) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, .); - } -#endif - - /* Add binary directory */ -#ifdef PHP_WIN32 - binary_location = (char *) emalloc(MAXPATHLEN); - if (GetModuleFileName(0, binary_location, MAXPATHLEN)==0) { - efree(binary_location); - binary_location = NULL; - } -#else - if (sapi_module.executable_location) { - binary_location = estrdup(sapi_module.executable_location); - } else { - binary_location = NULL; - } -#endif - if (binary_location) { - char *separator_location = strrchr(binary_location, DEFAULT_SLASH); - - if (separator_location) { - *(separator_location+1) = 0; - } - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, binary_location); - efree(binary_location); - } - - /* Add environment location */ - if (env_location[0]) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, env_location); - } - - /* Add default location */ -#ifdef PHP_WIN32 - default_location = (char *) emalloc(MAXPATHLEN+1); - - if (0 GetWindowsDirectory(default_location, MAXPATHLEN)) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, default_location); - } - efree(default_location); -#else - default_location = PHP_CONFIG_FILE_PATH; - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, default_location); -#endif - } + /* build the search path */ + free_ini_search_path = php_prepare_ini_search_path(php_ini_search_path); PG(safe_mode) = 0; PG(open_basedir) = NULL; @@ -333,7 +612,7 @@ struct stat statbuf; if (!VCWD_STAT(sapi_module.php_ini_path_override, statbuf)) { - if (!((statbuf.st_mode S_IFMT) == S_IFDIR)) { + if (S_ISDIR(statbuf.st_mode) == 0) { fh.handle.fp = VCWD_FOPEN(sapi_module.php_ini_path_override, r); fh.filename = sapi_module.php_ini_path_override; } = END PATCH === -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 9:14 AM To: Edin Kadribasic Cc: David Viner; Php-Dev@lists. php. net Subject: Re: [PHP-DEV] [PATCH] include statement in php.ini file I'm not very concerned either way on the .ini extension restriction. Let's go ahead and commit this with the include to additional_ini name change. Perhaps the commit will stir up more feedback since there has been so little. Some feedback: +1 for additional_ini=/path/to/new/additional.ini -1 for including whole directories, since I think it has to great a WTF factor. Without scanning a directory, you would have to automatically edit and insert directives into files in order to add an extension automatically. It is so much easier just to drop a single ext.ini file in a dedicated ini dir and have it be read. Scanning a file and trying to figure out where to add stuff and making sure it isn't already there is a real PITA. Like the silly LoadModule stuff that apxs does. You often end up with multiple LoadModule lines for the same module. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] [PATCH] include statement in php.ini file
This code is executed at the time when the php.ini file is parsed. So this happens the first time the php engine starts (i.e., for Apache, at the time of apache parent startup). The additional_ini capability has the same security issues that the php.ini file itself has. So I'm not sure there are any new security concerns that surface because of this patch. You mention the ini_set/ini_get functions. There's also the parse_ini_file extension function (http://www.php.net/manual/en/function.parse-ini-file.php) which allows you to parse your own ini files at runtime. I think this function along with ini_set are sufficient to handle run time ini files. dave -Original Message- From: James Moore [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 10:32 AM To: 'Php-Dev@lists. php. net' Cc: 'David Viner'; 'Rasmus Lerdorf'; 'Edin Kadribasic' Subject: RE: [PHP-DEV] [PATCH] include statement in php.ini file In general I agree with this proposal but I have some concerns, as I am not familiar with the ini code these may be unfounded, introducing it may well 1) Introduce Security Concerns depending on the time the ini file is loaded (IF I have safe_mode = on then you include an ini file with safe_mode = off what happens) 2) If people use this with out understanding when the ini file is loaded. Php.ini is loaded before script execution/compilation this ini file would probably be loaded at compile or runtime so settings like sort_tags = on and register_globals = on would not make sense. Therefore, if appropriate (IE my concerns are well founded) I suggest we add two new ini directives to the php.ini file (allow.runtime.ini.files (Which defaults to off due to the fact that someone may upgrade to Php 4.3.x or whenever this appears and not update their php.ini file leaving their system vurlnerable to safe_mode among others being turned off at runtime). At the same time we add the directive disallow.directive.overwrite which is given a list of ini directives which cannot be overwritten by runtime loading). I realize there is ini_set and ini_get at the moment and these issues may have already been dealt with, as I said I do not know quite what the situation is with the ini code as I am unfamilar with it but I feel that these things need to be thought about before the patch makes it into a release (or at least rubished enough so that Im sure these concerns are unfounded :). Cheers, - James I'm not very concerned either way on the .ini extension restriction. Let's go ahead and commit this with the include to additional_ini name change. Perhaps the commit will stir up more feedback since there has been so little. Some feedback: +1 for additional_ini=/path/to/new/additional.ini -1 for including whole directories, since I think it has to great a WTF factor. Without scanning a directory, you would have to automatically edit and insert directives into files in order to add an extension automatically. It is so much easier just to drop a single ext.ini file in a dedicated ini dir and have it be read. Scanning a file and trying to figure out where to add stuff and making sure it isn't already there is a real PITA. Like the silly LoadModule stuff that apxs does. You often end up with multiple LoadModule lines for the same module. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] [PATCH] include statement in php.ini file
I thought about reading only *.ini files when directories were specified, and the main reason I didn't implement that is simply because I thought the PHP include functionality should behave like Apache's Include directive. Apache's include doesn't worry about ~ files and .ORIG or .OLD or .bak files, so why should PHP's? That said, I am happy to rework the patch to only include files that end in .ini if the group feels this is the appropriate action of an include statement. (Personally, I think if a user puts garbage in a directory, then says include that directory, then c'est la vie.) If the term include is not a good keyword, I'm also happy to rework the patch to use any keyword the group prefers. additional_ini sounds good to me, and probably doesn't carry the other control-structure baggage. dave -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 5:17 AM To: Zeev Suraski Cc: David Viner; Php-Dev@lists. php. net Subject: RE: [PHP-DEV] [PATCH] include statement in php.ini file I suppose using a PHP keyword like include may lead to a desire for other PHP keywords, perhaps something like: additional_ini = /some/dir additional_ini = /some/file.ini Not sure why you want to limit it to one. Also, they can be nested, so in /some/dir/foo.ini you might have: additional_ini = /some/dir/my_ext My only concern about the full directory scanning and reading every file is that there could be foo.ini~ created by editors or other such junk in there. So perhaps only read in .ini files, or maybe use the new glob code to allow /some/dir/*.ini to specify. Probably going a bit too far as well. -Rasmus On Thu, 26 Sep 2002, Zeev Suraski wrote: I'm concerned that adding this directive will make lead to control structures requirements. However, it is quite useful for modular deployment; So, my suggestion is: - Don't introduce 'include' - Introduce a special 'additional_ini_directory' (name subject to change) which will be read after php.ini loads up. Only one (at most) such directory, full path required. This gives you (as far as I can tell) the modular deployment features, but won't make people beg for 'if'. Thoughts? Zeev At 00:50 26/09/2002, Rasmus Lerdorf wrote: I don't see any obvious problems with this patch except for a couple of extrananeos changes. I was a bit indisposed last week and didn't really follow the discussion leading up to this, but I have read the archive. I agree that going full out with PHP-parsed .ini files is going too far, but being able to do a simple include of individual files or directories of files seems like a useful thing to me when building a modular PHP deployment system. -Rasmus -- 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] fnmatch
The test for fnmatch is incorrectly giving yes on beos. Autoconf 2.53 seems to have a new test specifically for fnmatch so could we use their test in php? This is probably easier than requiring an upgrade to 2.53 for autoconf for such a trivial little thing... david -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] include statement in php.ini file
Hi, I've been working with Brian France on a patch that will allow users to include other ini files from the php.ini (see http://marc.theaimsgroup.com/?t=10317976671r=1w=2 for earlier discussions). This patch allows the following functionality from the php.ini file: include = file include = directory include = /full/path/to/file include = /full/path/to/directory When a full path is not specified, it will look in the same directory which were examined to find the php.ini file itself. When a directory is specified, it will process each file in the directory. The files included are process exactly as the php.ini file is. (The included ini files are handled as ini files, not .php files.) This is nearly identical to the Include capability of Apache's configuration files. For those interested in using an Include feature from within the php.ini, please let me know if this is sufficient. Thanks Dave Viner -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] [PATCH] include statement in php.ini file
= NULL; - } -#endif - if (binary_location) { - char *separator_location = strrchr(binary_location, DEFAULT_SLASH); - - if (separator_location) { - *(separator_location+1) = 0; - } - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, binary_location); - efree(binary_location); - } - - /* Add environment location */ - if (env_location[0]) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, env_location); - } - - /* Add default location */ -#ifdef PHP_WIN32 - default_location = (char *) emalloc(MAXPATHLEN+1); - - if (0 GetWindowsDirectory(default_location, MAXPATHLEN)) { - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, default_location); - } - efree(default_location); -#else - default_location = PHP_CONFIG_FILE_PATH; - if (*php_ini_search_path) { - strcat(php_ini_search_path, paths_separator); - } - strcat(php_ini_search_path, default_location); -#endif - } + /* build the search path */ + free_ini_search_path = php_prepare_ini_search_path(php_ini_search_path); PG(safe_mode) = 0; PG(open_basedir) = NULL; @@ -333,7 +605,7 @@ struct stat statbuf; if (!VCWD_STAT(sapi_module.php_ini_path_override, statbuf)) { - if (!((statbuf.st_mode S_IFMT) == S_IFDIR)) { + if (S_ISDIR(statbuf.st_mode) == 0) { fh.handle.fp = VCWD_FOPEN(sapi_module.php_ini_path_override, r); fh.filename = sapi_module.php_ini_path_override; } == END PATCH == -Original Message- From: David Viner [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 24, 2002 1:40 PM To: Php-Dev@lists. php. net Subject: [PHP-DEV] [PATCH] include statement in php.ini file Hi, I've been working with Brian France on a patch that will allow users to include other ini files from the php.ini (see http://marc.theaimsgroup.com/?t=10317976671r=1w=2 for earlier discussions). This patch allows the following functionality from the php.ini file: include = file include = directory include = /full/path/to/file include = /full/path/to/directory When a full path is not specified, it will look in the same directory which were examined to find the php.ini file itself. When a directory is specified, it will process each file in the directory. The files included are process exactly as the php.ini file is. (The included ini files are handled as ini files, not .php files.) This is nearly identical to the Include capability of Apache's configuration files. For those interested in using an Include feature from within the php.ini, please let me know if this is sufficient. Thanks Dave Viner -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] compilation order platform dependent?
Hi, I noticed that when I build php from the CVS source on Windows, the Zend/ directory is always compiled before the main/ directory. But on FreeBSD, it's the other way around. Is this intentional? or have I messed up my build environment somehow? thanks dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] compilation order platform dependent?
not of the straight source... but a patch that i'm developing works on one platform but not on the other (relies on a generated header file in Zend/). dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 12:06 PM To: David Viner Cc: Php-Dev@lists. php. net Subject: Re: [PHP-DEV] compilation order platform dependent? On Mon, 23 Sep 2002, David Viner wrote: Hi, I noticed that when I build php from the CVS source on Windows, the Zend/ directory is always compiled before the main/ directory. But on FreeBSD, it's the other way around. Is this intentional? or have I messed up my build environment somehow? This is very normal. Do you have any problems compiling? Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ini question
Here is my modified php_init_handler from mod_php4.c static void php_init_handler(server_rec *s, pool *p) { fprintf(stderr,mod_php4.c: php_init_handler: starting to run\n); register_cleanup(p, NULL, (void (*)(void *))apache_php_module_shutdown_wrapper, (void (*)(void *))php_module_shutdown_for_exec); if (!apache_php_initialized) { apache_php_initialized = 1; #ifdef ZTS tsrm_startup(1, 1, 0, NULL); #endif sapi_startup(apache_sapi_module); php_apache_startup(apache_sapi_module); } #if MODULE_MAGIC_NUMBER = 19980527 { TSRMLS_FETCH(); if (PG(expose_php)) { ap_add_version_component(PHP/ PHP_VERSION); } } #endif fprintf(stderr,mod_php4.c: php_init_handler: all completed\n); } Should this print to stderr every time the init_handler is called regardless of the value of apache_php_initialized? Is there some other function that is called by apache for initialization? dave -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 6:25 PM To: David Viner Cc: Php-Dev@lists. php. net Subject: RE: [PHP-DEV] ini question I am sure that you are correct, Rasmus, and apache is calling it twice, but what I don't understand is, why are the messages not identical? Because we check for it? Sorry, I didn't actually read through your code examples, but I bet if you trace back you will find that the apache_php_initialized check that we do is the cause of the different output on the two calls. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ini question
thanks... i got this working properly. dave -Original Message- From: David Viner [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 9:05 AM To: Php-Dev@lists. php. net Subject: RE: [PHP-DEV] ini question Here is my modified php_init_handler from mod_php4.c static void php_init_handler(server_rec *s, pool *p) { fprintf(stderr,mod_php4.c: php_init_handler: starting to run\n); register_cleanup(p, NULL, (void (*)(void *))apache_php_module_shutdown_wrapper, (void (*)(void *))php_module_shutdown_for_exec); if (!apache_php_initialized) { apache_php_initialized = 1; #ifdef ZTS tsrm_startup(1, 1, 0, NULL); #endif sapi_startup(apache_sapi_module); php_apache_startup(apache_sapi_module); } #if MODULE_MAGIC_NUMBER = 19980527 { TSRMLS_FETCH(); if (PG(expose_php)) { ap_add_version_component(PHP/ PHP_VERSION); } } #endif fprintf(stderr,mod_php4.c: php_init_handler: all completed\n); } Should this print to stderr every time the init_handler is called regardless of the value of apache_php_initialized? Is there some other function that is called by apache for initialization? dave -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 6:25 PM To: David Viner Cc: Php-Dev@lists. php. net Subject: RE: [PHP-DEV] ini question I am sure that you are correct, Rasmus, and apache is calling it twice, but what I don't understand is, why are the messages not identical? Because we check for it? Sorry, I didn't actually read through your code examples, but I bet if you trace back you will find that the apache_php_initialized check that we do is the cause of the different output on the two calls. -Rasmus -- 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] ini question
After some further tweaking and fprintf-ing, it appears that the second round of parser print-outs somehow do not rely upon the lexer in zend_ini_scanner.l. So I am completely unsure of what is going on. Is there any documentation that I should read to help me understand this? (I own and have examined the OReilly Writing Apache Modules book (in case this was the child processes each parsing the ini file on their own) but to no avail.) Is there Zend documentation of the startup process? dave -Original Message- From: David Viner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 18, 2002 3:45 PM To: Php-Dev@lists. php. net Subject: [PHP-DEV] ini question Hi, I turned on DEBUG_CFG_PARSER in Zend/zend_ini_parser.y which has the parser spit out each key-value pair it discovers. I noticed when I start my Apache, it actually spits everything out twice. The first time I know comes from php_module_startup (called from php_apache_startup which is the init handler in sapi/apache/mod_php4.c). What causes the parser to spit out all the key-value pairs the second time? dave -- 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] ini question
Sure. When I set #define DEBUG_CFG_PARSER 1 in zend_ini_parser.y, I see lots of: 'short_open_tag' = '1' 'asp_tags' = '' ... output to stderr when PHP starts. I believe that this is the bison parser discovering statements from the php.ini file. When I run the php from the command line, it outputs these statements just once. However, when I run php as an apache module, it outputs these statements once, then it outputs Apache/1.3.23 (Win32) PHP/4.3.0-dev running... then it outputs all the statements again. What I don't understand is why it happens a second time. thanks dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 4:35 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP-DEV] ini question Can you provide some context? Devon Original Message: - From: David Viner [EMAIL PROTECTED] Date: Thu, 19 Sep 2002 16:16:18 -0700 To: [EMAIL PROTECTED] Subject: RE: [PHP-DEV] ini question After some further tweaking and fprintf-ing, it appears that the second round of parser print-outs somehow do not rely upon the lexer in zend_ini_scanner.l. So I am completely unsure of what is going on. Is there any documentation that I should read to help me understand this? (I own and have examined the OReilly Writing Apache Modules book (in case this was the child processes each parsing the ini file on their own) but to no avail.) Is there Zend documentation of the startup process? dave -Original Message- From: David Viner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 18, 2002 3:45 PM To: Php-Dev@lists. php. net Subject: [PHP-DEV] ini question Hi, I turned on DEBUG_CFG_PARSER in Zend/zend_ini_parser.y which has the parser spit out each key-value pair it discovers. I noticed when I start my Apache, it actually spits everything out twice. The first time I know comes from php_module_startup (called from php_apache_startup which is the init handler in sapi/apache/mod_php4.c). What causes the parser to spit out all the key-value pairs the second time? dave -- 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 mail2web - Check your email from the web at http://mail2web.com/ . -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ini question
I suspect that this is where my error is. But I have added another fprintf to the mod_php4.c file that prints a message when entering the php_init_handler function and when it exits. The php_init_handler function is registered as the module_init callback which I believe is what Apache calls when initializing the module. Amazingly, it prints this: (I added the parentheses below to identify the src file) mod_php4.c: php_init_handler: starting to run (zend_ini_scanner.l) lex returning 'startofphpini' (zend_ini_scanner.l) lex returning 'hereami' (zend_ini_parser.y) 'startofphpini' = 'hereami' (zend_ini_scanner.l) lex returning 'engine' (zend_ini_parser.y) 'engine' = '1' (zend_ini_scanner.l) lex returning 'short_open_tag' (zend_ini_parser.y) 'short_open_tag' = '1' (zend_ini_scanner.l) lex returning 'asp_tags' (zend_ini_parser.y) 'asp_tags' = '' .. snipped .. mod_php4.c: php_init_handler: all completed mod_php4.c: php_init_handler: all completed Apache/1.3.23 (Win32) PHP/4.3.0-dev running... (zend_ini_parser.y) 'startofphpini' = 'hereami' (zend_ini_parser.y) 'engine' = '1' (zend_ini_parser.y) 'short_open_tag' = '1' (zend_ini_parser.y) 'asp_tags' = '' .. snipped .. At the initial step, it is clear that the ini parser is called by php_init_handler. But why is the same php_ini_handler: starting to run not printed the second time? And, why does the parser no longer call the lexer? I am sure that you are correct, Rasmus, and apache is calling it twice, but what I don't understand is, why are the messages not identical? dave -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 5:21 PM To: David Viner Cc: Php-Dev@lists. php. net Subject: RE: [PHP-DEV] ini question Apache calls the module startup hook twice. On Thu, 19 Sep 2002, David Viner wrote: After some further tweaking and fprintf-ing, it appears that the second round of parser print-outs somehow do not rely upon the lexer in zend_ini_scanner.l. So I am completely unsure of what is going on. Is there any documentation that I should read to help me understand this? (I own and have examined the OReilly Writing Apache Modules book (in case this was the child processes each parsing the ini file on their own) but to no avail.) Is there Zend documentation of the startup process? dave -Original Message- From: David Viner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 18, 2002 3:45 PM To: Php-Dev@lists. php. net Subject: [PHP-DEV] ini question Hi, I turned on DEBUG_CFG_PARSER in Zend/zend_ini_parser.y which has the parser spit out each key-value pair it discovers. I noticed when I start my Apache, it actually spits everything out twice. The first time I know comes from php_module_startup (called from php_apache_startup which is the init handler in sapi/apache/mod_php4.c). What causes the parser to spit out all the key-value pairs the second time? dave -- 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 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] ini question
Hi, I turned on DEBUG_CFG_PARSER in Zend/zend_ini_parser.y which has the parser spit out each key-value pair it discovers. I noticed when I start my Apache, it actually spits everything out twice. The first time I know comes from php_module_startup (called from php_apache_startup which is the init handler in sapi/apache/mod_php4.c). What causes the parser to spit out all the key-value pairs the second time? dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [RFC] include_ini and include_ini_dir
Hmm... in the apache world, the srm.conf and access.conf were deprecated, but the Include directive in the configuration file is still maintained. That is, by default, people use a single apache configuration file. However, for specialized cases, like Brian's, people have the ability to use multiple files if they want the extra work of multiple configuration files. It seems to me that PHP could do something similar. That is, by default, there is a single php.ini file. If some developer or company wants multiple ini files for whatever reason, then we could have this Include directive. I haven't looked at Brian's implementation, but I think this concept of allowing 'included' config files is really powerful. I mean, why not let people who like multiple config files have them? That doesn't mean that everyone will use them, just people who want the extra headache/flexibility of them. dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 12:26 AM To: Devon O'Dell Cc: PHP Developers Mailing List Subject: Re: [PHP-DEV] Re: [RFC] include_ini and include_ini_dir On Thu, 12 Sep 2002, Devon O'Dell wrote: Not to be a troll, but weren't srm.conf and access.conf deprecated for a reason? I think it was the reason that it made configuration less clear. Three files for one thing isn't just 'right'. Derick --- Did I help you? http://www.derickrethans.nl/link.php?url=giftlist Frequent ranting: http://www.derickrethans.nl/ --- PHP: Scripting the Web - [EMAIL PROTECTED] All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net --- -- 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] Re: [RFC] include_ini and include_ini_dir
So is it fair to say that we (Brian and others who are interested) should persue a robust patch that will allow for an Include directive in PHP's ini file that functions like Apache's Include directive? dave -Original Message- From: Wez Furlong [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:34 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; Matthew Walker Subject: Re: [PHP-DEV] Re: [RFC] include_ini and include_ini_dir On 09/12/02, [EMAIL PROTECTED] wrote: On Thu, 12 Sep 2002, Matthew Walker wrote: For what it's worth, here's my +1 on enabling a php-parsed .ini file. And to maintain backwards compatibility, if the file had no php tags in it, it could be parsed as per the old .ini method. I'm -1 on this complexity. Having an include is OK, but making it a PHP Script will make it very complex, and it's also very hard to implement. Also, do we really need that? Likewise, I'm -1 on any kind of scripting in the .ini file. I know it's nice to have clever features, but considering that there are only a finite number of options and that in most cases these are set only once for a particular build, I don't think we need it. I can understand Brian's intended use for include (but think that they could be OK without it), but there aren't really that many options or situations where you might need such a degree of flexibility for a couple of options. Most of the options can be set within a PHP script anyway. --Wez. -- 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] translate capitalized functions in create_stubs
Hi When we use prototype files for ext_skel, we noticed that a function name with capital letters doesn't work properly since php extension must have lowercase function names. However, ext_skel doesn't warn or fix an erroneous prototype file. Here's a small patch to the create_stubs file which will both warn users that a function name from the prototype file contains capital letters, and it will lowercase the function name. Out of curiosity, why ext_skel/create_stubs a shell/awk script? Were it written in perl, Windows users could use it too. Is there a design reason for shell/awk or is it just historical? dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PATCH] translate capitalized functions in create_stubs
inlining patch since my attachment seemed to fail... dave === --- create_stubs.ORIG Tue Sep 3 13:21:41 2002 +++ create_stubsTue Sep 3 13:33:01 2002 @@ -153,6 +153,13 @@ spec_str = spec_str \ +## php extension must use lower case function names. +## this will translate any capitalized letter to lowercase +## and warn the user + if (match(func_name,[A-Z]) != 0) { + printf(NOTICE: lower casing function name '%s'\n,func_name) + func_name = tolower(func_name) + } funcs[num_funcs] = func_name types[num_funcs] = func_type maxargs[num_funcs] = args_max -Original Message- From: David Viner [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 1:43 PM To: Php-Dev@lists. php. net Subject: [PHP-DEV] [PATCH] translate capitalized functions in create_stubs Hi When we use prototype files for ext_skel, we noticed that a function name with capital letters doesn't work properly since php extension must have lowercase function names. However, ext_skel doesn't warn or fix an erroneous prototype file. Here's a small patch to the create_stubs file which will both warn users that a function name from the prototype file contains capital letters, and it will lowercase the function name. Out of curiosity, why ext_skel/create_stubs a shell/awk script? Were it written in perl, Windows users could use it too. Is there a design reason for shell/awk or is it just historical? dave -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: davidtran
The develop php runtime and to managed multiple projects. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] new webdav patch
I think allowing php users to process webdav methods in user-space is an awesome idea. One question I have, why are the MKCOL, DELETE, and UNLOCK methods not listed? according to RFC 2518 (http://ftp.ics.uci.edu/pub/ietf/webdav/protocol/rfc2518.txt), DAV clients are required to support them. Also, would you be interested in including the extensions to DAV defined by DeltaV? This would add the following methods: VERSION-CONTROL, REPORT, CHECKIN, CHECKOUT, UNCHECKOUT, MKWORKSPACE, UPDATE, LABEL, MERGE, BASELINE-CONTROL, MKACTIVITY. I'm not terribly familiar w/ the DeltaV stuff, but it seems that if php is getting the ability to handle dav request, why not include this extension. You can read more about deltav at http://www.webdav.org/deltav/protocol/rfc3253.html thanks dave -Original Message- From: Christian Stocker [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 1:46 PM To: Rasmus Lerdorf Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DEV] new webdav patch On Tue, 20 Aug 2002, Rasmus Lerdorf wrote: On Tue, 20 Aug 2002, Rasmus Lerdorf wrote: It is getting there. You are checking for POST under webdav_methods when POST is already allowed by default, so it is a redundant strcmp(). oops. that one slipped through and was certainly not intended to be there :) Anybody else here have an issue with adding this configue option which will allows webdav methods through to be handled in user space? Just to avoid missunderstandings: It's not a ./configure option, but a php.ini/.htaccess option, which is turned off by default. Sorry, right, I should have been more explicit. Do you have karma to commit this? If nobody screams, I suggest you commit it. No, I don't have karma for the whole php4 tree. Someone else has to commit it or if noone wants to be blamed later, someone has to give me karma :) christian -- 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] shared extension linking
On Mon, 19 Aug 2002, Ron Lange wrote: Hello, I need to link some external libs statically into a shared php extension. If I compile this extension statically with php, all external libs also linked statically in, the extension can be used. I can't figure out how I have to modify the many configuration files to get the additional libs statically linked in if the extension is build seperately. I just insert '-L/pathtolibs -llibnames...' into the INCLUDES-var of config_vars.mk. Bad way, I know... But if I want the extension to be compiled as shared object the additional libs are not linked statically in. By the way, if I use phpize to prepare the extension, the proper php prefix isn't right set. I manually have to replace it in config_vars.mk. Unfortunately the self-contained-extension-readme doesn't cover this issue. Please help... Use PHP_ADD_LIBRARY_WITH_PATH or PHP_ADD_LIBRARY in your config.m4 -\- David Eriksson -/- I personally refuse to use inferior tools because of ideology. - Linus Torvalds -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] shared extension linking
On Mon, 19 Aug 2002, Ron Lange wrote: Hi David, David Eriksson wrote: Use PHP_ADD_LIBRARY_WITH_PATH or PHP_ADD_LIBRARY in your config.m4 Already done... My config.m4: Note: IndiComm, ndr and mmem have to be statically linked into this module! -- INDI_PROJECT_PATH=/home/ron/INDI PHP_ARG_ENABLE(indi, whether to enable indi support, [ --enable-indi Enable indi support]) if test $PHP_INDI != no; then Add this here: PHP_SUBST(INDI_SHARED_LIBADD) AC_ADD_INCLUDE($INDI_PROJECT_PATH/include) AC_ADD_INCLUDE($INDI_PROJECT_PATH/GUI/include) AC_ADD_INCLUDE($INDI_PROJECT_PATH/NDR/include) AC_ADD_INCLUDE($INDI_PROJECT_PATH/include/dacs) PHP_ADD_LIBRARY_WITH_PATH(IndiComm,$INDI_PROJECT_PATH/lib) PHP_ADD_LIBRARY_WITH_PATH(ndr,$INDI_PROJECT_PATH/lib) PHP_ADD_LIBRARY_WITH_PATH(mmem,$INDI_PROJECT_PATH/lib) Change the above like this: PHP_ADD_LIBRARY_WITH_PATH(IndiComm,$INDI_PROJECT_PATH/lib, INDI_SHARED_LIBADD) PHP_EXTENSION(indi, $ext_shared) fi -- My Makefile.in: -- # $Id$ LTLIBRARY_SOURCES = indi.c LTLIBRARY_SHARED_NAME = indi.la Add this: LTLIBRARY_SHARED_LIBADD = $(INDI_SHARED_LIBADD) Hope this helps! -\- David Eriksson -/- I personally refuse to use inferior tools because of ideology. - Linus Torvalds -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: results of mysql_fetch are returning the incorrect records
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I have problems with mysql_fetch return the wrong records. If I execute the sql statement in mysql, I receive the correct results. When I used mysql_fetch function, it does not return the correct results. Below is my function and the format sql statement function companiesByBusiness_ZipCode_BusinessOrContactName( $ctgyno, $zipcode, $businessandcontactname ) { $sql = select company_no, name, contact, business_phone, mobile_phone, services_desc, brief_bio, pager, address, city, state, zipcode, picture_file, case ifnull(picture_file, 'No Picture') when 'No Picture' then 'b' else 'a' end pic_ind from company; if( $ctgyno != ALL) { $sql .= where business_ctgy_no = $ctgyno; if( $zipcode != ) { $sql .= and (zipcode like '.substr( $zipcode, 0, 3 ).%' and zipcode != '$zipcode'); } if( $businessandcontactname != ) { $sql .= and (name = '$businessandcontactname'; $sql .= or contact = '$businessandcontactname'); } $sql .= order by pic_ind, name, company_no; } $query = mysql_query( $sql ) or die( $sql.p.mysql_error() ); //$numrows = mysql_num_rows( $query ); while( $assoc = mysql_fetch_assoc( $query ) ) { $rows[] = $assoc; sql statement: select company_no, name, contact, business_phone, mobile_phone, services_desc, brief_bio, pager, address, city, state, zipcode, picture_file, case ifnull(picture_file, 'No Picture') when 'No Picture' then 'b' else 'a' end pic_ind from company where business_ctgy_no = 1 and (zipcode like '276%' and zipcode != '27616') and (name = 'Gil Bryan' or contact = 'Gil Bryan') order by pic_ind, name, company_no It seems like it is ignoring the last condition, name = 'Gil Bryan' or contact = 'Gil Bryan'). Any help is greatly appreciated. } return $rows; } First, I'd suggest echoing $sql just before you send it to mysql to ensure that what you hope is there is actually there. Also, what are you returning from your function? Or how are you using the data gathered from your tables? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php