Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Edward Z. Yang
Johannes Schlüter wrote: > What else would you expect? For me it looks right. I talked about this with Steph Fox, and the behavior is correct. Please disregard GP! :-) -- Edward Z. YangGnuPG: 0x869C48DA HTML Purifier Anti-XSS Filter [[ 3FA8 E9

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Pierre Joye
On Feb 12, 2008 6:56 PM, Jani Taskinen <[EMAIL PROTECTED]> wrote: > And for the reasons why they're not needed in 5.2 apply to any other PHP > version. version_compare() is there for a reason, USE IT! No more > constants for same thing, thankyouverymuch. Read: it is easier, faster handier to use

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Jani Taskinen
On Tue, 2008-02-12 at 19:05 +0100, Pierre Joye wrote: > On Feb 12, 2008 6:56 PM, Jani Taskinen <[EMAIL PROTECTED]> wrote: > > And for the reasons why they're not needed in 5.2 apply to any other PHP > > version. version_compare() is there for a reason, USE IT! No more > > constants for same thing,

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Jani Taskinen
And for the reasons why they're not needed in 5.2 apply to any other PHP version. version_compare() is there for a reason, USE IT! No more constants for same thing, thankyouverymuch. --Jani On Mon, 2008-02-11 at 11:35 -0500, Ilia Alshanetsky wrote: > We spoke about this via IM, but its only fair

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Jochem Maas
Pierre Joye schreef: Hi Jochen, On Feb 12, 2008 12:22 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: Sebastian Bergmann schreef: Jochem Maas schrieb: Output: C:\ Is this intended? Yes, or what would you expect? possibly 'C:' ? Is "C:" not the volume whereas "C:\" is the root directory on the

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Johannes Schlüter
Hi, On Mon, 2008-02-11 at 22:30 -0500, "Edward Z. Yang" wrote: > Hello all, I was documenting the __DIR__ patch, and I ran across some > curious behavior when the PHP file was in the Windows filesystem root: > > C:\test.php > echo __DIR__; > ?> > > Output: > C:\ > > Is this intended? What els

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Pierre Joye
Hi Jochen, On Feb 12, 2008 12:22 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > Sebastian Bergmann schreef: > > Jochem Maas schrieb: > Output: > C:\ > Is this intended? > >>> Yes, or what would you expect? > >> possibly 'C:' ? > > > > Is "C:" not the volume whereas "C:\" is the root

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Jochem Maas
Sebastian Bergmann schreef: Jochem Maas schrieb: Output: C:\ Is this intended? Yes, or what would you expect? possibly 'C:' ? Is "C:" not the volume whereas "C:\" is the root directory on the volume? this is what I thought, kind of, but I was just proposing what the OP was expecting. it

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Sebastian Bergmann
Jochem Maas schrieb: Output: C:\ Is this intended? Yes, or what would you expect? possibly 'C:' ? Is "C:" not the volume whereas "C:\" is the root directory on the volume? -- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Pierre Joye
On Feb 12, 2008 12:02 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > Pierre Joye schreef: > > Hi Edward, > > > > On Feb 12, 2008 4:30 AM, Edward Z. Yang <[EMAIL PROTECTED]> wrote: > >> Hello all, I was documenting the __DIR__ patch, and I ran across some > >> curious behavior when the PHP file was in

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Jochem Maas
Pierre Joye schreef: Hi Edward, On Feb 12, 2008 4:30 AM, Edward Z. Yang <[EMAIL PROTECTED]> wrote: Hello all, I was documenting the __DIR__ patch, and I ran across some curious behavior when the PHP file was in the Windows filesystem root: C:\test.php Output: C:\ Is this intended? Yes, or

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-12 Thread Pierre Joye
Hi Edward, On Feb 12, 2008 4:30 AM, Edward Z. Yang <[EMAIL PROTECTED]> wrote: > Hello all, I was documenting the __DIR__ patch, and I ran across some > curious behavior when the PHP file was in the Windows filesystem root: > > C:\test.php > echo __DIR__; > ?> > > Output: > C:\ > > Is this intende

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Edward Z. Yang
Hello all, I was documenting the __DIR__ patch, and I ran across some curious behavior when the PHP file was in the Windows filesystem root: C:\test.php Output: C:\ Is this intended? -- Edward Z. YangGnuPG: 0x869C48DA HTML Purifier Anti-XSS

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Lars Strojny
Hi, Am Montag, den 11.02.2008, 13:25 -0800 schrieb Stanislav Malyshev: [...] > I'm not sure what happens if zend_dirname returns 0, also what happens > if this constant is used in eval(), stream of anything else with > non-canonical filename? Except that, looks ok. > Some tests won't hurt though

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Stanislav Malyshev
and it should be good. Stan, looks ok for you? Done: http://lars.schokokeks.org/php/dir-constant-6.diff I'm not sure what happens if zend_dirname returns 0, also what happens if this constant is used in eval(), stream of anything else with non-canonical filename? Except that, looks ok. Some

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Johannes Schlüter
On Mon, 2008-02-11 at 17:51 +0100, "Pierre Joye" wrote: > > Yes that name is fine, bunt wondering: When/Where do you get this > > information and where from? What's the impact for build > > snapshots/releases? Afaik the scripts for that work on cvs exports where > > Good point, I did not check th

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Lars Strojny
Hi, Am Montag, den 11.02.2008, 17:58 +0100 schrieb Pierre Joye: [...] > One more thing: > > const size_t filename_len = strlen(filename); > > and it should be good. Stan, looks ok for you? Done: http://lars.schokokeks.org/php/dir-constant-6.diff cu, Lars signature.asc Description: Dies ist e

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Pierre Joye
On Feb 11, 2008 5:55 PM, Lars Strojny <[EMAIL PROTECTED]> wrote: > Hi Pierre, > > Am Montag, den 11.02.2008, 17:42 +0100 schrieb Pierre Joye: > [...] > > Looks better :) > > Thank you! > > > I did not test it but it looks good. Did you run the tests suite? > > > > + dirname = estrndup(filename,

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Lars Strojny
Hi Pierre, Am Montag, den 11.02.2008, 17:42 +0100 schrieb Pierre Joye: [...] > Looks better :) Thank you! > I did not test it but it looks good. Did you run the tests suite? > > + dirname = estrndup(filename, strlen(filename)); > + zend_dirname(dirname, strlen(dirname)); > > One strlen

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Pierre Joye
On Feb 11, 2008 5:40 PM, Johannes Schlüter <[EMAIL PROTECTED]> wrote: > Pierre, > > On Mon, 2008-02-11 at 15:42 +0100, "Pierre Joye" wrote: > > On Feb 11, 2008 3:20 PM, Pierre Joye <[EMAIL PROTECTED]> wrote: > > > On Feb 9, 2008 2:39 PM, Marcus Boerger <[EMAIL PROTECTED]> wrote: > > > > Hello Pierr

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Pierre Joye
Hi Lars, On Feb 11, 2008 5:25 PM, Lars Strojny <[EMAIL PROTECTED]> wrote: > Hi Pierre, > > Am Montag, den 11.02.2008, 17:15 +0100 schrieb Pierre Joye: > [...] > > I did not see the zend_dirname usage (wrong link?) and did not find > > either this function/macro. > > > > I slightly modified it to a

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Johannes Schlüter
Pierre, On Mon, 2008-02-11 at 15:42 +0100, "Pierre Joye" wrote: > On Feb 11, 2008 3:20 PM, Pierre Joye <[EMAIL PROTECTED]> wrote: > > On Feb 9, 2008 2:39 PM, Marcus Boerger <[EMAIL PROTECTED]> wrote: > > > Hello Pierre, > > > yeah nice idea. I am wondering if you might want to add the cvs tag,

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Ilia Alshanetsky
We spoke about this via IM, but its only fair that the answer be provided via a mailing list as well. From my standpoint this is a feature, although a minute one and 5.2 is not in a feature mode right now, we have 5.3 and PHP 6 for that. Secondly these constants are of dubious value (beside

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Lars Strojny
Hi Pierre, Am Montag, den 11.02.2008, 17:15 +0100 schrieb Pierre Joye: [...] > I did not see the zend_dirname usage (wrong link?) and did not find > either this function/macro. > > I slightly modified it to avoid too much strlen and to do not process > the string if there is nothing to process. P

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Pierre Joye
On Feb 11, 2008 4:25 PM, Lars Strojny <[EMAIL PROTECTED]> wrote: > Hi, > > Am Montag, den 11.02.2008, 12:51 +0100 schrieb Lars Strojny: > [...] > > [1] http://lars.schokokeks.org/php/dir-constant-2.diff > > Updated version. Moved and renamed php_dirname() to zend_dirname() to > not use PHP internal

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Lars Strojny
Hi, Am Montag, den 11.02.2008, 12:51 +0100 schrieb Lars Strojny: [...] > [1] http://lars.schokokeks.org/php/dir-constant-2.diff Updated version. Moved and renamed php_dirname() to zend_dirname() to not use PHP internals in the Zend Engine. Fixed a memory leak and added the TSRM-includes to have s

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Pierre Joye
On Feb 11, 2008 3:20 PM, Pierre Joye <[EMAIL PROTECTED]> wrote: > On Feb 9, 2008 2:39 PM, Marcus Boerger <[EMAIL PROTECTED]> wrote: > > Hello Pierre, > > yeah nice idea. I am wondering if you might want to add the cvs tag, too? > > E.g.: PHP_TAG = 'PHP_5_3' > > > I'll commit the patch later today

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Pierre Joye
On Feb 9, 2008 2:39 PM, Marcus Boerger <[EMAIL PROTECTED]> wrote: > Hello Pierre, > yeah nice idea. I am wondering if you might want to add the cvs tag, too? > E.g.: PHP_TAG = 'PHP_5_3' I'll commit the patch later today, I think PHP_BRANCHE sounds better than PHP_TAG, or PHP_CVS_TAG (but if we

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Lars Strojny
Hi, Am Sonntag, den 10.02.2008, 21:11 -0800 schrieb Stanislav Malyshev: [...] > Actually, just as __FILE__, __LINE__, __CLASS__ etc. dirname(__FILE__) > can be a parser constant. And if somebody produces a good name and a > patch for it, I see no reason to reject it. Does anybody? So here we ar

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-11 Thread Lars Strojny
Hi Stanislav, Am Sonntag, den 10.02.2008, 21:11 -0800 schrieb Stanislav Malyshev: [...] > Actually, just as __FILE__, __LINE__, __CLASS__ etc. dirname(__FILE__) > can be a parser constant. And if somebody produces a good name and a > patch for it, I see no reason to reject it. Does anybody? For

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-10 Thread Stanislav Malyshev
Is there any chance that dirname(__FILE__) being exposed as a constant, i.e. __DIRNAME__? No. Constants are per request, dirname(__FILE__) is obviously different per file. Actually, just as __FILE__, __LINE__, __CLASS__ etc. dirname(__FILE__) can be a parser constant. And if somebody produ

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-10 Thread Markus Fischer
Jan Schneider wrote: Zitat von Jingcheng Zhang <[EMAIL PROTECTED]>: Hello, Is there any chance that dirname(__FILE__) being exposed as a constant, i.e. __DIRNAME__? No. Constants are per request, dirname(__FILE__) is obviously different per file. That's not entirely true, isn't it? Think

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-10 Thread Jan Schneider
Zitat von Jingcheng Zhang <[EMAIL PROTECTED]>: Hello, Is there any chance that dirname(__FILE__) being exposed as a constant, i.e. __DIRNAME__? No. Constants are per request, dirname(__FILE__) is obviously different per file. Jan. -- Do you need professional PHP or Horde consulting? htt

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-10 Thread Jingcheng Zhang
Hello, Is there any chance that dirname(__FILE__) being exposed as a constant, i.e. __DIRNAME__? On Feb 9, 2008 9:42 PM, Pierre Joye <[EMAIL PROTECTED]> wrote: > Hi Marcus, > > On Feb 9, 2008 2:39 PM, Marcus Boerger <[EMAIL PROTECTED]> wrote: > > Hello Pierre, > > yeah nice idea. I am wonderi

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-09 Thread Pierre Joye
Hi Marcus, On Feb 9, 2008 2:39 PM, Marcus Boerger <[EMAIL PROTECTED]> wrote: > Hello Pierre, > yeah nice idea. I am wondering if you might want to add the cvs tag, too? > E.g.: PHP_TAG = 'PHP_5_3' Oh right, nice idea :) It would be nice to have it as well. The idea is to ease the tests writing

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-09 Thread Marcus Boerger
Hello Pierre, yeah nice idea. I am wondering if you might want to add the cvs tag, too? E.g.: PHP_TAG = 'PHP_5_3' marcus Friday, February 8, 2008, 1:52:27 PM, you wrote: > Hi, > Testing the PHP version can be much easier and faster if the versions > details were exposed via the constants, lik

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-08 Thread David Coallier
On Feb 8, 2008 7:52 AM, Pierre Joye <[EMAIL PROTECTED]> wrote: > Hi, > > Testing the PHP version can be much easier and faster if the versions > details were exposed via the constants, like what we use internally. > This little patch expose what we have in php_version.h > > > #define PHP_MAJOR_VERS

Re: [PHP-DEV] [patch] expose PHP version details as constants

2008-02-08 Thread Stanislav Malyshev
Hi! Testing the PHP version can be much easier and faster if the versions details were exposed via the constants, like what we use internally. This little patch expose what we have in php_version.h Looks ok, shouldn't harm anything. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTEC