Re: [PHP-DEV] [RFC] APC/PHP Lazy Loading
Hi, Personally, I like the patch except for some small possible tweaks, and I believe it can't make any harm with lazy loading disabled. Could you provide some benchmark results? APC patch to play with it and see advantages/disadvantages? Thanks. Dmitry. shire wrote: Lukas Kahwe Smith wrote: On 22.02.2009, at 01:10, shire wrote: I've just checked into APC CVS preliminary support for Lazy Loading classes and functions. This means that rather than copying function entries into EG(function_table) and EG(class_table) when an include happen it will mark the functions/classes as available and only actually insert them into the tables when they are called. This is done via hooks added into the various hash table lookups in PHP. I've placed a patch for PHP_5_3 at: http://tekrat.com/downloads/bits/apc_lazy_php53.patch I did not read through the entire thread. As things are close to RC state in 5.3, I would prefer to not do any non bug fixes at this stage. Then again if the benefits are huge and the risk is low it can be considered of course .. Yep, I should have been clearer here. ;-) I don't believe this patch is ready to be committed and I'm not advocating for inclusion in the php53 release. I have some more adjustments I'd like to make to both the APC code and this patch, both for optimization, cleanliness, and to ensure it's the best possible implementation for future enhancements (such as lazy loading methods). I'm more interested in getting constructive feedback and any benchmark results so I can make adjustments to the current code. However, I would like to come back with improved patches and get it included in the next major release as appropriate. I'm all about fixing the remaining php53 todos/bugs and getting this release out! I hope posting this wasn't a distraction from that. Thanks! -shire -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Changing build configuration acinclude.m4
Does anyone (where's Jani?) want to comment on updating (*) the definition of PHP_SHLIB_SUFFIX_NAMES in acinclude.m4? The PHP_SHLIB_SUFFIX_NAMES macro is very simplistic in setting the SHLIB_SUFFIX_NAME shared lib file extension. In comparison, the AC_LIBTOOL_SYS_DYNAMIC_LINKER macro in build/libtool.m4 is more finegrained, in particular in differentiating between HP-UX Itanium and HP-UX PA RISC. The base problem was reported for the OCI8 extension in http://pecl.php.net/bugs/bug.php?id=15016 An untested patch for acinclude.m4 is: --- acinclude.m4.orig 2008-12-03 13:55:53.0 -0800 +++ acinclude.m42009-03-10 13:57:10.0 -0700 @@ -1975,8 +1975,16 @@ SHLIB_DL_SUFFIX_NAME=$SHLIB_SUFFIX_NAME case $host_alias in *hpux*[)] - SHLIB_SUFFIX_NAME=sl - SHLIB_DL_SUFFIX_NAME=sl + case $host_cpu in + ia64*[)] + SHLIB_SUFFIX_NAME=so + SHLIB_DL_SUFFIX_NAME=so + ;; + *[)] + SHLIB_SUFFIX_NAME=sl + SHLIB_DL_SUFFIX_NAME=sl + ;; + esac ;; *darwin*[)] SHLIB_SUFFIX_NAME=dylib Is $host_cpu appropriately set at this point of configuration? Is there a reason why PHP_SHLIB_SUFFIX_NAMES doesn't use AC_LIBTOOL_SYS_DYNAMIC_LINKER? Unfortunately I don't have any HP-UX boxes to test on. Chris (*) No Lukas, I'm not suggesting doing before the next 5.3 Beta -- Email: christopher.jo...@oracle.com Tel: +1 650 506 8630 Twitter: http://twitter.com/ghrdFree PHP Book: http://tinyurl.com/UGPOM -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Towards 5.3 RC
Stanislav Malyshev wrote: > Hi! > >> That said: On the wiki is a list of open items >> http://wiki.php.net/todo/php53#next_release_beta2rc1 > > I don't think #21 there is a bug - AFAIK client of get_class_name is > supposed to free it - which happens automatically if this is assigned to > zval, but otherwise it should be handled by calling code. This is likely a problem in xdebug (CVS) which I was running, which of course is also not yet fully ready for PHP 5.3, so I think #21 can be removed. Greg -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] About GSoC 2009
Hello Johannes, Wednesday, February 11, 2009, 12:29:12 PM, you wrote: > Hi, > last weekend at FOSDEM in Brussels Leslie Hawthorn announced this year's > Google Summer of Code program. Meanwhile the FAQ including the timeline > has been published. > http://code.google.com/opensource/gsoc/2009/faqs.html > According to that participating organizations are published on March 18. > As of then we should have a good ideas page motivating students to > contact us early, while the official student applications won't start > until March 23. The sooner we hear from them the better our selection > process can be, that didn't run perfect last year. > Currently the ideas page is still quite short. It would be nice to fill > it up while ideas might be quite rough, too. Last year we had 10 > accepted projects, by now we have 3 ideas. If you volunteer as mentor > please mind the program schedule, so you are available during that time > and especially during the evaluation time. (While last year the dates > where postponed by a week...) Last year it was a bit frustrating to get > everybody to fill out this paperwork. > http://wiki.php.net/gsoc/2009/ > Talking about paperwork: Scott agreed to do the bureaucratic work this > year and to act as primary administrator. I hope we get it running > smoother than last year where I jumped in just from time to time when I > found out the original admin didn't have enough time. > Everybody: come up with ideas and write them down > Scott: run it from here :-) As an update to this, I have filed the application. And Scott and I are listed as admins. Best regards, Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Cloning of objects passed as parameters
Hello Frankie, Tuesday, March 10, 2009, 5:19:32 PM, you wrote: > I'm writing a PHP class with a method that has to be passed a > DOMDocument object, and it needs to retain that object throughout the > life of its instantiation. However, the (dom_object *) returned from > zend_parse_method_parameters is just a pointer to the passed object, > and so it disappears when the original document is unset or goes out of > scope. How would one go about cloning the DOMDocument to save in the > class's struct? > example: > ZEND_METHOD(xydelta, setStartDocument) { > zval *id, *doc = NULL; > xydelta_object *intern; > if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), > "Oo", &id, xydelta_ce, &doc) == FAILURE) { > RETURN_FALSE; > } > intern = (xydelta_object *)zend_object_store_get_object(id TSRMLS_CC); > if (intern != NULL) { > // Error checking removed for brevity... > // ... > // This pointer cannot be accessed once the object that was > used as > the first parameter goes out of scope > intern->libxml_start_doc = (php_libxml_node_object *) > zend_object_store_get_object(doc TSRMLS_CC); > } > } DOMDocuments are reference counted, hence zou can simplz increase their refcount when storing the connection and delete the ref when dropping the connection, probably in your destructor. Best regards, Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] Bug #46926 - mktime() is slow when passed negative arguments
Hi, I've provided a patch for Bug #46926 [1]. [1] http://bugs.php.net/bug.php?id=46926 -- Martin McNickle -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] APC/PHP Lazy Loading
Lukas Kahwe Smith wrote: On 22.02.2009, at 01:10, shire wrote: I've just checked into APC CVS preliminary support for Lazy Loading classes and functions. This means that rather than copying function entries into EG(function_table) and EG(class_table) when an include happen it will mark the functions/classes as available and only actually insert them into the tables when they are called. This is done via hooks added into the various hash table lookups in PHP. I've placed a patch for PHP_5_3 at: http://tekrat.com/downloads/bits/apc_lazy_php53.patch I did not read through the entire thread. As things are close to RC state in 5.3, I would prefer to not do any non bug fixes at this stage. Then again if the benefits are huge and the risk is low it can be considered of course .. Yep, I should have been clearer here. ;-) I don't believe this patch is ready to be committed and I'm not advocating for inclusion in the php53 release. I have some more adjustments I'd like to make to both the APC code and this patch, both for optimization, cleanliness, and to ensure it's the best possible implementation for future enhancements (such as lazy loading methods). I'm more interested in getting constructive feedback and any benchmark results so I can make adjustments to the current code. However, I would like to come back with improved patches and get it included in the next major release as appropriate. I'm all about fixing the remaining php53 todos/bugs and getting this release out! I hope posting this wasn't a distraction from that. Thanks! -shire -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PATCH] Netlink sockets support for Linux
Hello, > This patch adds ability to send or receive data using Netlink [1] > sockets in Linux OS using Socket Functions in PHP. If you're going > to commit this patch, some additions to documentation will be > needed. Just let me know. I would very appreciate your comments! > [1] http://en.wikipedia.org/wiki/Netlink New version: http://www.progtech.ru/~oleg/php-netlinkV2.txt Some more changes. Fixed socket_getpeername and socket_getsockname functions to understand AF_NETLINK sockets. Patch made for PHP_5_3 branch. Any thoughts or opinions? -- wbr, Oleg -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Towards 5.3 RC
Hi! That said: On the wiki is a list of open items http://wiki.php.net/todo/php53#next_release_beta2rc1 I don't think #21 there is a bug - AFAIK client of get_class_name is supposed to free it - which happens automatically if this is assigned to zval, but otherwise it should be handled by calling code. -- Stanislav Malyshev, Zend Software Architect s...@zend.com http://www.zend.com/ (408)253-8829 MSN: s...@zend.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Cloning of objects passed as parameters
I'm writing a PHP class with a method that has to be passed a DOMDocument object, and it needs to retain that object throughout the life of its instantiation. However, the (dom_object *) returned from zend_parse_method_parameters is just a pointer to the passed object, and so it disappears when the original document is unset or goes out of scope. How would one go about cloning the DOMDocument to save in the class's struct? example: ZEND_METHOD(xydelta, setStartDocument) { zval *id, *doc = NULL; xydelta_object *intern; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oo", &id, xydelta_ce, &doc) == FAILURE) { RETURN_FALSE; } intern = (xydelta_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern != NULL) { // Error checking removed for brevity... // ... // This pointer cannot be accessed once the object that was used as the first parameter goes out of scope intern->libxml_start_doc = (php_libxml_node_object *) zend_object_store_get_object(doc TSRMLS_CC); } } -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Towards 5.3 RC
Hi, I wrote a mail last Friday about this but it seems like it got lost. I wanted to go RC on Thursday, as this now would be a rather short-time announcement (while quite a few devs already knew) this plan has changed by a week: PHP 5.3.0 RC 1 is now scheduled for Thursday 2009/03/19. This means we'll enter the pre-build commit-freeze for build fixes only on Wednesday 2009/03/18. As there were some misunderstandings what "build fixes only" means before here my reading of that: Build fixes are changes to source files (.c, .h, .re, ...) which fix compilation of the code on a supported platform (and don't break it for others). Build fixes also include fixes for tests, as long as the diff makes the changes clear (a complete rewrite of a test isn't clear, a change from %a to %s or additional cleanup is), as well as fixes to README files and similar. If in doubt please try to commit your stuff sooner or ask :-) That said: On the wiki is a list of open items http://wiki.php.net/todo/php53#next_release_beta2rc1 Item 1 is, of course, the big one: Bug fixing. Most of the ones filed against 5.3 are assigned. If you have bugs assigned to yourself but won't be able to fix it soonish please un-assign it with a comment - especially if you consider it critical so somebody else can take over. There are also many bugs filed against 5.2 (or older versions) while I won't consider most of the release critical for 5.3. Some other parts of that todo list are fixed (like the UPGRADING guide) or just need to be committed (new ini files) Please take a look. Other than that I have two main concerns: - Unknown bugs in Namespaces/Closures/... which will only be found in real life testing, not sure how to get them properly tested. - Accidental BC breaks, for instance in edge cases while changing to zend_parse_parameters. There were some fixes already, but more testing with real applications should still help (what I'm doing on my private server in a "production" environment for instance) So please test your own PHP code as well as apps you use on 5.3. Thanks. So devs please check over open bugs and open todo items. And everybody please help by testing (and I'm sure the doc team welcomes assistance). I also welcome feedback (using a mail directly to me for instance) if you tested some bigger apps (bugs should go to the bug tracker, of course) since feedback like "my 1M loc app works like a charm" helps me, too. Thanks so much, johannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Bug #45799 - imagepng() crashes on empty image
Patch is in the tracker now. -- Martin On Tue, 2009-03-10 at 12:19 +0100, Pierre Joye wrote: > hi, > > Please post a link to the patch in the bug tracker directly. > > Thanks for your work, > > Cheers, > > On Tue, Mar 10, 2009 at 12:17 PM, Martin McNickle > wrote: > > Hi all, > > > > I've created a simple patch for Bug #45799 [1] > > > > It employs a simple check to see if there are any colors associated with > > the image before outputting the PNG header. > > > > The patch is against CVS 5.3, shown below for convenience. I can create > > patches for the other branches if required. The tests pass. > > > > This is my first patch to PHP, so I've done anything wrong, give me some > > pointers as to how to fix it. > > > > Thanks, > > > > -- Martin McNickle > > > > [1] http://bugs.php.net/bug.php?id=45799 > > > > Index: ext/gd/libgd/gd_png.c > > === > > RCS file: /repository/php-src/ext/gd/libgd/gd_png.c,v > > retrieving revision 1.17.4.2.2.5.2.3 > > diff -u -r1.17.4.2.2.5.2.3 gd_png.c > > --- ext/gd/libgd/gd_png.c 14 Jan 2009 10:16:15 - > > 1.17.4.2.2.5.2.3 > > +++ ext/gd/libgd/gd_png.c 10 Mar 2009 11:12:02 - > > @@ -650,6 +650,12 @@ > >png_set_PLTE(png_ptr, info_ptr, palette, colors); > >} > > > > + if (colors <= 0 && !im->trueColor) { > > + php_gd_error("gd-png error: Invalid number of colors in > > palette./martin"); > > + png_destroy_write_struct (&png_ptr, &info_ptr); > > + return; > > + } > > + > >/* write out the PNG header info (everything up to first IDAT) */ > >png_write_info(png_ptr, info_ptr); > > > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Bug #45799 - imagepng() crashes on empty image
hi, Please post a link to the patch in the bug tracker directly. Thanks for your work, Cheers, On Tue, Mar 10, 2009 at 12:17 PM, Martin McNickle wrote: > Hi all, > > I've created a simple patch for Bug #45799 [1] > > It employs a simple check to see if there are any colors associated with > the image before outputting the PNG header. > > The patch is against CVS 5.3, shown below for convenience. I can create > patches for the other branches if required. The tests pass. > > This is my first patch to PHP, so I've done anything wrong, give me some > pointers as to how to fix it. > > Thanks, > > -- Martin McNickle > > [1] http://bugs.php.net/bug.php?id=45799 > > Index: ext/gd/libgd/gd_png.c > === > RCS file: /repository/php-src/ext/gd/libgd/gd_png.c,v > retrieving revision 1.17.4.2.2.5.2.3 > diff -u -r1.17.4.2.2.5.2.3 gd_png.c > --- ext/gd/libgd/gd_png.c 14 Jan 2009 10:16:15 - > 1.17.4.2.2.5.2.3 > +++ ext/gd/libgd/gd_png.c 10 Mar 2009 11:12:02 - > @@ -650,6 +650,12 @@ > png_set_PLTE(png_ptr, info_ptr, palette, colors); > } > > + if (colors <= 0 && !im->trueColor) { > + php_gd_error("gd-png error: Invalid number of colors in > palette./martin"); > + png_destroy_write_struct (&png_ptr, &info_ptr); > + return; > + } > + > /* write out the PNG header info (everything up to first IDAT) */ > png_write_info(png_ptr, info_ptr); > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] Bug #45799 - imagepng() crashes on empty image
Hi all, I've created a simple patch for Bug #45799 [1] It employs a simple check to see if there are any colors associated with the image before outputting the PNG header. The patch is against CVS 5.3, shown below for convenience. I can create patches for the other branches if required. The tests pass. This is my first patch to PHP, so I've done anything wrong, give me some pointers as to how to fix it. Thanks, -- Martin McNickle [1] http://bugs.php.net/bug.php?id=45799 Index: ext/gd/libgd/gd_png.c === RCS file: /repository/php-src/ext/gd/libgd/gd_png.c,v retrieving revision 1.17.4.2.2.5.2.3 diff -u -r1.17.4.2.2.5.2.3 gd_png.c --- ext/gd/libgd/gd_png.c 14 Jan 2009 10:16:15 - 1.17.4.2.2.5.2.3 +++ ext/gd/libgd/gd_png.c 10 Mar 2009 11:12:02 - @@ -650,6 +650,12 @@ png_set_PLTE(png_ptr, info_ptr, palette, colors); } + if (colors <= 0 && !im->trueColor) { + php_gd_error("gd-png error: Invalid number of colors in palette./martin"); + png_destroy_write_struct (&png_ptr, &info_ptr); + return; + } + /* write out the PNG header info (everything up to first IDAT) */ png_write_info(png_ptr, info_ptr); Index: ext/gd/libgd/gd_png.c === RCS file: /repository/php-src/ext/gd/libgd/gd_png.c,v retrieving revision 1.17.4.2.2.5.2.3 diff -u -r1.17.4.2.2.5.2.3 gd_png.c --- ext/gd/libgd/gd_png.c 14 Jan 2009 10:16:15 - 1.17.4.2.2.5.2.3 +++ ext/gd/libgd/gd_png.c 10 Mar 2009 11:12:02 - @@ -650,6 +650,12 @@ png_set_PLTE(png_ptr, info_ptr, palette, colors); } + if (colors <= 0 && !im->trueColor) { + php_gd_error("gd-png error: Invalid number of colors in palette./martin"); + png_destroy_write_struct (&png_ptr, &info_ptr); + return; + } + /* write out the PNG header info (everything up to first IDAT) */ png_write_info(png_ptr, info_ptr); -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Patch and test cases too for
2009/3/2 Scott MacVicar : > Richard Quadling wrote: >> 2009/3/2 Scott MacVicar : >>> Richard Quadling wrote: Hi. Regarding http://bugs.php.net/bug.php?id=47493, I've supplied a patch to the unit tests too. Any chance this could get committed to 5.2+ >>> I'm too convinced of the parameter name and I don't think its something >>> that should be added to 5.2.9 since its a feature. >>> >>> Scott >>> >> >> 5.3+ would be OK then. >> >> As to the param name, I'm not actually changing the name, just adding >> another flag. >> >> In javascript's terminology,the output is an array ... >> >> [] >> >> or a hash >> >> {} >> >> So forcing a hash for arrays is pretty much what would be wanted and I >> as I comment in the request, we have a "force" option when coming FROM >> json data ... json_decode ( string $json [, bool $assoc= false [, int >> $depth= 512 ]] ) >> >> And the "name" of the param here is appropriate to PHP's use (assoc is >> not part of JSON's or JS's terminology). >> >> If you can think of a better name for the flag, then I'd be glad to use it. >> > > The JSON spec refers to them as arrays or objects though, as does our > documentation I believe. > > PHP_JSON_FORCE_OBJECT > > I however have another patch for more strict encoding so I'll try to > roll this in a single update. > > Scott > First of all, this isn't a "why is this not done yet" message. Honestly. Do you have any timeframe for this though? Do you think it will be ready for 5.3RC1? Thank you, Richard Quadling. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] APC/PHP Lazy Loading
On 22.02.2009, at 01:10, shire wrote: I've just checked into APC CVS preliminary support for Lazy Loading classes and functions. This means that rather than copying function entries into EG(function_table) and EG(class_table) when an include happen it will mark the functions/classes as available and only actually insert them into the tables when they are called. This is done via hooks added into the various hash table lookups in PHP. I've placed a patch for PHP_5_3 at: http://tekrat.com/downloads/bits/apc_lazy_php53.patch I did not read through the entire thread. As things are close to RC state in 5.3, I would prefer to not do any non bug fixes at this stage. Then again if the benefits are huge and the risk is low it can be considered of course .. regards, Lukas Kahwe Smith m...@pooteeweet.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php