[PHP-DEV] cvsclean removes pear/PEAR on OS X 10.2
I think this is the darned case-insensitivity causing a problem again. the pear/.cvsignore file lists 'pear' - meaning the installer, presumably - but when cvsclean does a remove of it, it ends up removing the PEAR directory. (this came up because the 10.2 upgrade installed a too-new version of autoconf, so buildconf is running cvsclean) i honestly can't see what to do about it except to build the 'pear' file inside a directory, so that it's not parallel to the PEAR directory... -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: #20596 [Opn-Bgs]: date function gives wrong result for format 't'
Derick Rethans [EMAIL PROTECTED] wrote: On Sat, 23 Nov 2002, Melvyn Sopacua wrote: So ehm - are Michael and Derick on a 'date' or what? At 16:57 23-11-2002, [EMAIL PROTECTED] wrote: http://bugs.php.net/?id=20596edit=1 http://bugs.php.net/?id=20592edit=1 http://bugs.php.net/?id=20594edit=1 No, but Michael has no account to close the bogus reports :) True - just trying to answer the easy ones, so the PHP developers can save some time. Regards... Michael -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Errors and exceptions?
# [EMAIL PROTECTED] / 2002-11-12 13:08:33 +0100: On Tue, 2002-11-12 at 07:54, Derick Rethans wrote: And that's why I would be -1 on the first one. However, the whole error reporting is a pretty mess, with some extensions implementing other 'philosiphies' then others. Getting this all nice and clean is another point we should address in PHP 5 (just like Stig mentioned). I did not mention that here, but I would like to go through the PHP source and introduce Unix-style (EPERM etc.) error codes in all calls to php_error(). But that's not a topic for this mailing list. Call to nonexistent function - ENOTIMPL? :) -- If you cc me or remove the list(s) completely I'll most likely ignore your message.see http://www.eyrie.org./~eagle/faqs/questions.html -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2]Errors and exceptions?
On Sun, 24 Nov 2002, Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2002-11-12 13:08:33 +0100: On Tue, 2002-11-12 at 07:54, Derick Rethans wrote: And that's why I would be -1 on the first one. However, the whole error reporting is a pretty mess, with some extensions implementing other 'philosiphies' then others. Getting this all nice and clean is another point we should address in PHP 5 (just like Stig mentioned). I did not mention that here, but I would like to go through the PHP source and introduce Unix-style (EPERM etc.) error codes in all calls to php_error(). But that's not a topic for this mailing list. Call to nonexistent function - ENOTIMPL? :) Nope, ENOSYS would be appropiate for that. #define ENOSYS 38 /* Function not implemented */ - Sascha -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Errors and exceptions?
# [EMAIL PROTECTED] / 2002-11-24 15:39:23 +0100: On Sun, 24 Nov 2002, Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2002-11-12 13:08:33 +0100: On Tue, 2002-11-12 at 07:54, Derick Rethans wrote: And that's why I would be -1 on the first one. However, the whole error reporting is a pretty mess, with some extensions implementing other 'philosiphies' then others. Getting this all nice and clean is another point we should address in PHP 5 (just like Stig mentioned). I did not mention that here, but I would like to go through the PHP source and introduce Unix-style (EPERM etc.) error codes in all calls to php_error(). But that's not a topic for this mailing list. Call to nonexistent function - ENOTIMPL? :) Nope, ENOSYS would be appropiate for that. #define ENOSYS 38 /* Function not implemented */ Sorry, my mistake. Anyway, I *really* like the idea. I guess it could speed some stuff up. Consider: do { if (!file_exists($file)) { $code = ENOENT; break; } if (!is_readable($file)) { $code = EACCES; break; } ... } switch ($code = fopen($file, 'r')) { case ENOENT: ... case EACCES: ... } -- If you cc me or remove the list(s) completely I'll most likely ignore your message.see http://www.eyrie.org./~eagle/faqs/questions.html -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] hi memory usage with php-cli
Hi, I have a huge xml-file with about 500k lines, which gives around 17000 products, which I import to a database. The problem is that the script is taking a lot of memory, about 100mb when it's finished. The script goes something like this $product = array(), then I add some values to the array, name, art.no, and when the product is done, I do $product = array(), and do the same thing over and over. Is there any way to configure php/zend to use less memory? I've tried #define ZEND_DISABLE_MEMORY_CACHE 1 which doesn't help. best regards Robin -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] hi memory usage with php-cli
Hi, For your $product array, are you using associative keys on each, so like: $product = array('name' = $name, 'art.no' = $artnum, ... ); If so, you might find that if you replaced the string keys with constants, you would save memory, because a constant is an integer and takes less storage space than a string. Example: ?php define(PROD_NAME, 0); define(PROD_ARTNUM, 1); # ... $product = array(PROD_NAME = $name, PROD_ARTNUM = $artnum, ... ); ? I think that might save you some memory. Just an idea. Pete -Original Message- From: Robin Ericsson [mailto:[EMAIL PROTECTED]] Sent: November 24, 2002 12:20 PM To: [EMAIL PROTECTED] Subject: [PHP-DEV] hi memory usage with php-cli Hi, I have a huge xml-file with about 500k lines, which gives around 17000 products, which I import to a database. The problem is that the script is taking a lot of memory, about 100mb when it's finished. The script goes something like this $product = array(), then I add some values to the array, name, art.no, and when the product is done, I do $product = array(), and do the same thing over and over. Is there any way to configure php/zend to use less memory? I've tried #define ZEND_DISABLE_MEMORY_CACHE 1 which doesn't help. best regards Robin -- 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: #20596 [Opn-Bgs]: date function gives wrong resultfor format 't'
On Sun, 24 Nov 2002, Michael Mauch wrote: Derick Rethans [EMAIL PROTECTED] wrote: No, but Michael has no account to close the bogus reports :) True - just trying to answer the easy ones, so the PHP developers can save some time. And that is very much appreciated :) Derick -- - Derick Rethans http://derickrethans.nl/ PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/ - -- 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?
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] 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] Capturing headers with output buffering?
Bad idea or not (I don't think it will be fast and there are some problems with some of the ideas you want to pull off, imho) I certainly believe that reinventing the wheel can be a healthy exercise. That having been said, most of what you want to accomplish here requires a single lon-living process. php only sends headers once per request/c[lg]i invocations , so this won't do what you're hoping for. Seems to me that you would want to do something like this, using the cli: startup listen while 1: accept read request set buffering true use a userspace function to generate headers use a userspace function to generate body capture buffer close buffer send captured buffer over socket You should be able to modify the sapi functions to buffer headers as well, but a) then your server is written in C, not in php and b) I think this isn't useful for too many applications. George On Sunday, November 24, 2002, at 06:06 PM, David Brown wrote: 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] Capturing headers with output buffering?
You can probably learn a lot by example. There is a pretty complete HTTP server written in PHP available here: http://nanoweb.si.kz/ Chris -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] error reporting for PHP5
I've been cut off from my e-mail since Thursday, so I'm going to have to play catch-up a little here... Issue #1: Maxim's Error handling suggestions I completely agree with the concept of language-specific errors. I'll be happy to implement a system on that. However before we do that I think what should be changed and why needs to be explored a little more... I am pretty much in favor for most of what Maxim is suggesting on this, however one thing that I wasn't sure is being suggested is splitting the constants into two three groups -- type, module, error. Where E_NOTICE, E_ERROR, etc. would be the type of error, MOD_CURL, MOD_FOOBAR would be the module in which the error occurred and E_CURL_BADURL would be the actual error code. As for custom error codes, I'm not sure how these would be handled in PHP... In fact, I'm not entirely convince that we really should have this sort of thing (i.e. trigger_error()). In my experience (and maybe I'm unique) I have never actually used trigger_error() in any sort of meaniful way. Rather, I simply deal with the error myself. I am open to hearing everyone's ideas on what could be done in this respect.. The best thought I would have is similar to Maxim's, where you could register your own module constant (see above) and error codes... Then PHP could just look them up in the XML document. Perhaps if this system was available (along with my patch) I'd be using them much more frequently. As for actual implementation, there would need to be a couple new directives: error_dir The directory containing the XMLs default_error_lang The language default for errors (perhaps we could use an already existing language directive?) And a few functions added/mod'd: Trigger_error($mod, $error) -- trigger an error with code $error in mod $mod (the type of error, E_ERROR, etc, is taken from the XML) Register_error($type, $mod, $error, $msg [, $lang]) -- register an error at runtime of type $type for module $mod, errorcode $error with the message $msg. An option parameter $lang specifies the language the error is in Include_errordef($file) -- Include an error defination XML file at run-time Set_error_language($lang) -- Set a new error-language (perhaps this would be better to just be set_language() for all of PHP?) Of course callback custom error handlers would have to be changed to accept only $mod, and $error Notice I left Maxim's suggestion of modify_error() out... The reason is because there should be no reason to modify the error message at runtime... If you want to specifically define an error to distinguish between an undefined username and an undefined variable Register_error(E_ERROR, USER_MYSCRIPT, E_MYSCRIPT_UNDEF); If(!isset($username)) trigger_error(USER_MYSCRIPT, E_MYSCRIPT_UNDEF); Issue #2: The 500 error... I'm -1 on this. The reason I'm -1 is because no one has shown me a reason why the 500 error is a more reasonable solution than the Patch I've already written which accomplishes the same thing. In fact, it does a better job because the error page knows exactly what went wrong (unlike a 500 error, which just means something went wrong). Issue #3: The redirect patch Although there are a few things to do for the patch before I commit (make it more friendly when other error handlers are used, use the argument_seperator from the INI, etc) it is basically ready and working. If no one has any serious objections I'll clean up the code and commit it when I've tested it. Also, this works out fairly well because the patch can be easily modified to work with the new system Maxim discussed. My 2c -- sorry for being long winded (had to catch up). John -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] [PATCH] Redirect on Error
[1] The annoying thing is that FATAL errors can't be handled by an error handler With the patch they can be handled without any issues. I don't like the 500 way either, because you simply loose the entire environment the bug occured in. You'll lose the entire environment in any FATAL error, period. If the parser dies, you just have to start from scratch in terms of the env... At least with the patch you can tell WHERE the error came from, etc. John Met vriendelijke groeten / With kind regards, Webmaster IDG.nl Melvyn Sopacua @Logan I spent a minute looking at my own code by accident. @Logan I was thinking What the hell is this guy doing? -- 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] Java extension fixes
I'm made a stability fix to the PHP Java extension. A full description of the changes as well as the updated java.c file (and patch) can be found here: http://tjw.org/php_java/ Can someone please add this to CVS or should I contact Sam Ruby (the orignal author) to do it? -Tony -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Java extension fixes
Tony J. White wrote: I'm made a stability fix to the PHP Java extension. A full description of the changes as well as the updated java.c file (and patch) can be found here: http://tjw.org/php_java/ Good to know that someone has the knowledge and the time to look after this abandoned extension. Can someone please add this to CVS As Rasmus already pointed out, the best way would be to get yourself a CVS account and commit your changes yourself. should I contact Sam Ruby (the orignal author) to do it? Good luck :-) -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] error reporting for PHP5
On Mon, 25 Nov 2002 01:04:00 -0500, you wrote: As for custom error codes, I'm not sure how these would be handled in PHP... In fact, I'm not entirely convince that we really should have this sort of thing (i.e. trigger_error()). In my experience (and maybe I'm unique) I have never actually used trigger_error() in any sort of meaniful way. Rather, I simply deal with the error myself. Sorry to jump in the middle of a conversation, but I just wanted to say that I personally use trigger_error() quite often. The site I maintain has a nice custom error handler which logs the error and emails the admins the error details + var dumps, etc. I often use trigger_error() in my code because it allows me to treat certain situations the same as a PHP generated error. Of course, I suppose I could just call my custom error handler directly but that seems less elegant...just MHO. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP Magick version 0.4a Released!
Hi I just had a very quick look at your code and didn't even try it out (lack of time...), but I'm just wondering, why you wrote you're own extension and didn't start with imagick from PECL ( http://pear.php.net/package-info.php?pacid=76 ) ? Maybe we really can join our efforts and do something together (I didn't work for a long time on ext/imagick..), it would be a pity, if we have 2 different imagemagick extensions in the long term :) so long chregu On Fri, 2002-11-22 at 23:08, Michael Montero wrote: Just released the next version of magick, the PHP ImageMagick extension. It's now available as this URL: http://magick.communityconnect.com/ Here are the latest changes: o functions added: magick_writeimages() magick_destroyhandle() magick_image2blob() magick_drawarc() magick_drawcircle() magick_drawpoint() magick_border() magick_frame() magick_raise() magick_getwidth() magick_getheight() magick_getmimetype() magick_setfillcolor() magick_setfontface() magick_charcoal() magick_implode() magick_oilpaint() magick_solarize() magick_swirl() magick_wave() o more preparation for image lists o fixed incorrect comments in some examples o fixed incorrect calls to magick_failedreason() and magick_faileddescription() in most examples o a number of examples weren't exiting properly on errors, that's been fixed o phpinfo() now displays available font family and font names o coolest function so far: magick_oilpaint(). The output is awesome! o added MaxRGB to phpinfo() section Got through quite a few things today. Shooting for beta release by the end of next week. -- Michael C. Montero Chief Technology Officer Community Connect Inc. Co-founder [EMAIL PROTECTED] -=-=-=-=-= Community Connect Inc. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The Premier Source of Interactive Online Communities149 Fifth Avenue http://www.CommunityConnectInc.com/ New York, NY 10010 http://www.AsianAvenue.com/ http://www.BlackPlanet.com/ Click into Asian AmericaThe World Is Yours http://www.MiGente.com/ http://www.DiversityJobMarket.com/ The Power of LatinosIn partnership with The New York Times - Your Message May Appear Below This Line -- christian stocker | bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | [EMAIL PROTECTED] | gnupg-keyid 0x5CE1DECB -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php