[PHP-DEV] Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/sockets sockets.c

2008-10-22 Thread Hannes Magnusson
On Wed, Oct 22, 2008 at 20:59, Arnaud Le Blanc <[EMAIL PROTECTED]> wrote: > lbarnaudWed Oct 22 18:59:34 2008 UTC > > Modified files: (Branch: PHP_5_3) >/php-srcNEWS >/php-src/ext/socketssockets.c > Log: > MFH: Fixed bug #46360 (TCP_NODELAY constan

Re: [PHP-DEV] Destructor Order

2008-10-22 Thread Evert | Filemobile
I believe the "end of your script" part is the problem. Imagine you have some object (say, ActiveRecord style) that writes itself to the database when it's destroyed if the data has been modified. Now cache that object in a static variable somewhere for performance. You're also using PDO,

Re: [PHP-DEV] Destructor Order

2008-10-22 Thread Larry Garfield
On Wednesday 22 October 2008 2:31:38 am Mike van Riel wrote: > >> Example destruction order: > >> 3 = database records (ActiveRecord or such) > >> 2 = database connection object > >> 1 = framework objects > >> 0 = objects with unspecified level > > > > Why would you need such thing? > > PHP uses r

Re: [PHP-DEV] [PATCH] Bug #46367 - fputcsv does not add the correct newline character on Windows

2008-10-22 Thread John Mertic
On Wed, Oct 22, 2008 at 1:16 PM, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote: > You cannot use smart_str_appendc() in this case, since the EOL could be a 2 > byte string "\r\n". > > smart_str_appendl(&csvline, PHP_EOL, sizeof(PHP_EOL)-1); should be used > here. > > On 22-Oct-08, at 2:35 PM, John Mer

Re: [PHP-DEV] Re: PHP 5.2.7RC1 Testing

2008-10-22 Thread steve
The more that gets moved from php into pecl, the more many of us rely on pecl builds to test php. Specificly in regards to 5.3 and 6.0... On Fri, Oct 17, 2008 at 8:52 AM, Pierre Joye <[EMAIL PROTECTED]> wrote: > hi, > > All references are now updated, in http://qa.php.net > http://bugs.php.net

Re: [PHP-DEV] [PATCH] Bug #46367 - fputcsv does not add the correct newline character on Windows

2008-10-22 Thread Ilia Alshanetsky
smart_str_appendl() would be faster since it'll avoid having to calculate the string length, and sizeof() can be used to determine the length of the constant, resulting in faster code. On a general note, I am not sure its a good idea to change the EOL for CSV file, since many scanners expec

Re: [PHP-DEV] [PATCH] Bug #46367 - fputcsv does not add the correct newline character on Windows

2008-10-22 Thread John Mertic
Hi Ilia, Sorry for my C confusion, like I said it's been awhile. Anyways, would smart_str_appends() be the correct function to use then? John Mertic [EMAIL PROTECTED] http://jmertic.wordpress.com "Explaining a joke is like dissecting a frog: you understand it better, but the frog dies in the pr

Re: [PHP-DEV] [PATCH] Bug #46367 - fputcsv does not add the correct newline character on Windows

2008-10-22 Thread Ilia Alshanetsky
You cannot use smart_str_appendc() in this case, since the EOL could be a 2 byte string "\r\n". smart_str_appendl(&csvline, PHP_EOL, sizeof(PHP_EOL)-1); should be used here. On 22-Oct-08, at 2:35 PM, John Mertic wrote: Hi Lars, Thanks for the pointers, updated the patch and added a test.

Re: [PHP-DEV] [PATCH] Bug #46367 - fputcsv does not add the correct newline character on Windows

2008-10-22 Thread John Mertic
Hi Lars, Thanks for the pointers, updated the patch and added a test. Index: file.c === RCS file: /repository/php-src/ext/standard/file.c,v retrieving revision 1.530 diff -u -r1.530 file.c --- file.c 21 Oct 2008 22:06:48 -

Re: [PHP-DEV] [PATCH] Bug #46367 - fputcsv does not add the correct newline character on Windows

2008-10-22 Thread John Mertic
Hi Stefan, The context on how this function is being used is the case where you are writing out to a file, so in this case I think we should be using the EOL standards of the underlying platform. If we were just keeping the output as a string, I could see us sticking with the standard newline char

Re: [PHP-DEV] [PATCH] Bug #46367 - fputcsv does not add the correct newline character on Windows

2008-10-22 Thread Lars Strojny
Hi John, Am Mittwoch, den 22.10.2008, 10:03 -0700 schrieb John Mertic: [...] > Below is a patch to fix this issue; it uses the constant PHP_EOL to > get the correct newline to use on the current platform: Thanks for your patch. A few things to mention, as it is your first patch: please use "diff

[PHP-DEV] [PATCH] Bug #46367 - fputcsv does not add the correct newline character on Windows

2008-10-22 Thread John Mertic
Hi All, My first patch so be gentle :-). Per the documentation for the fputcsv() function, it adds a newline to the end of the csv string it returns. However, it is hardcoded to be '\n' ( default for unix newline ), while Windows uses \r\n. PHP should do this as well. Below is a patch to fix thi

Re: [PHP-DEV] [PATCH] Allow unsetting headers previously set usingheader()

2008-10-22 Thread Stan Vassilev | FM
That isn't very intuitive. I would think it was a typo when reading such code and fix the header line... I'd suggest explicit header_remove("Vary"); Agreed, a specific function with a clear name sounds better. Christian, can you update the patch? - thanks! johannes I suggest header_remove(

Re: [PHP-DEV] [PATCH] Allow unsetting headers previously set using header()

2008-10-22 Thread Johannes Schlüter
Hi, On Mon, 2008-10-20 at 09:12 +0200, Hannes Magnusson wrote: > > I suggest extending the behaviour of header() so that when the first > > argument does not contain a colon (and does not begin with "HTTP/"), e.g. > > header('Vary'), it unsets the header with the specified name. I decided to > > e

Re: [PHP-DEV] Destructor Order

2008-10-22 Thread Stan Vassilev | FM
Hi, Naturally this line: "$this->addObject($this, $priority);" was meant to be: $destructManager->addObject($this, $priority);" ... Regards, Stan Vassilev -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Destructor Order

2008-10-22 Thread Stan Vassilev | FM
On Wed, Oct 22, 2008 at 5:03 AM, Ryan Panning <[EMAIL PROTECTED]> wrote: I've been wondering, is such a thing even possible? Is there a good way to implement an object destruct order? Here are my thoughts: In the class definition, specify what "level" of destruction the objects should be on. Ho

Re: [PHP-DEV] Destructor Order

2008-10-22 Thread Mike van Riel
Alexey Zakhlestin wrote: On Wed, Oct 22, 2008 at 5:03 AM, Ryan Panning <[EMAIL PROTECTED]> wrote: I've been wondering, is such a thing even possible? Is there a good way to implement an object destruct order? Here are my thoughts: In the class definition, specify what "level" of destruction the