Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Nathan Rixham
Tim Starling wrote:
 Stan Vassilev wrote:
 I hope PHP6 will remove this processing as register_globals will be
 completely removed at that point.
 
 I'd be happy if it stayed like it is, for backwards compatibility. 

Sometimes forwards compatibility has to take precedence though.

Linked data is set to explode around the net over the next year or two;
general form fields will soon be replaced with properties from
ontologies (such as foaf), people will have personal rdf graphs housed
in their browsers and autocomplete will populate forms where the
property uri's are known;  if these form elements all contain uri's with
dots swapped out with underscores then this could be a potentially big
problem for the giant global graph and PHP developers specifically.

All solved very easily by being able to ini switch this replacement
feature on and off.

on the server side..
http://example.org/ontology/0.1/some_property
becomes
http://example.org/ontology/0_1/some_property

how do you reverse replace the correct underscore with a dot?

if we use the input
name=data[http://example.org/ontology/0.1/some_property]; / workaround
in userland this is no doubt breaking many future browser extensions
looking for input name=http://example.org/ontology/0.1/some_property; /

quite sure a small patch and ini switch would cater for both BC and FC
in this case; even if it was removed all together then to achieve bc
would be a simple for loop and str_replace; hardly major.

regards!

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Richard Lynch
Once upon a time, a long time ago, PHP imported all GET/POST/COOKIE
data as variables, for the convenience of the developer.

This was called register_globals

$a.b is not a valid variable name, so it was changed to $a_b to be a
valid variable name.

Nowadays, I see no real reason to keep doing this, other than BC.

And I'm not sure who would actually use 'a.b' and then expect 'a_b',
but I have to assume somebody has done that, perhaps consuming an API
from somewhere else.

Short-term, your options are to use $_SERVER['REQUEST_URI'] and parse
it yourself, or don't do that.

Long-term, I suggest you lobby for this to change in PHP 6, if it
isn't already in the works.

For BC, I suppose PHP could have *both* 'a.b' and 'a_b', or yet
another php.ini flag (sorry!) to choose the behaviour.

On Wed, January 20, 2010 3:45 pm, Nathan Rixham wrote:
 Dots and spaces in variable names are converted to underscores. For
 example input name=a.b / becomes $_POST[a_b].

 Any reason why? and any way to modify this behaviour to preserve dots
 and spaces? (dots specifically)

 reason, when building linked data / rdf based applications using PHP
 it's most beneficial to use subject / predicate URIs (eg
 http://xmlns.com/foaf/0.1/mbox) as form input names.

 also worth noting that if you send:
   input name=a.b[c.d] /
 you'll receive the following in php:
   $_POST[a_b] = array('c.d' = val)
 note no conversion of c.d to c_d

 regards,

 Nathan

 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Some people ask for gifts here.
I just want you to buy an Indie CD for yourself:
http://cdbaby.com/search/from/lynch



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Dave Ingram
Richard Lynch wrote:
 For BC, I suppose PHP could have *both* 'a.b' and 'a_b'
+1 as a PHP user. For BC, I guess this should go without changing the
current precedence rules too, annoying though it might be.

At the moment: ?a_b=fooa.b=bar gives $_GET === array('a_b' = 'bar')
As I understand it with this proposal: ?a_b=fooa.b=bar would give
$_GET === array('a_b' = 'bar', 'a.b' = 'bar')

It would be nicer for it not to lose the original assignment (a_b =
foo) though, perhaps via an INI setting.


Dave

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Alexey Zakhlestin

On 21.01.2010, at 18:21, Richard Lynch wrote:
 
 For BC, I suppose PHP could have *both* 'a.b' and 'a_b', or yet
 another php.ini flag (sorry!) to choose the behaviour.

-1 from me.
I don't think we need to keep backward compatibility for this. PHP-6 is a major 
release, after all.

It would be absolutely enough to add optional var-name conversion to extract()
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Jack Timmons
On Thu, Jan 21, 2010 at 10:38 AM, Alexey Zakhlestin indey...@gmail.com wrote:

 -1 from me.
 I don't think we need to keep backward compatibility for this. PHP-6 is a 
 major release, after all.

 It would be absolutely enough to add optional var-name conversion to extract()

Agreed.

-- 
-Jack Timmons
http://www.trotlc.com
Twitter: @codeacula

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Nathan Rixham
Alexey Zakhlestin wrote:
 On 21.01.2010, at 18:21, Richard Lynch wrote:
 For BC, I suppose PHP could have *both* 'a.b' and 'a_b', or yet
 another php.ini flag (sorry!) to choose the behaviour.
 
 -1 from me.
 I don't think we need to keep backward compatibility for this. PHP-6 is a 
 major release, after all.
 
 It would be absolutely enough to add optional var-name conversion to extract()

any word from anybody on the development team to say if this removal of
dot conversion (whether optional or not) can be added to some todo list
or suchlike and rolled out at some point soon~ish?

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Christopher Jones


Nathan Rixham wrote:
 Alexey Zakhlestin wrote:
 On 21.01.2010, at 18:21, Richard Lynch wrote:
 For BC, I suppose PHP could have *both* 'a.b' and 'a_b', or yet
 another php.ini flag (sorry!) to choose the behaviour.
 -1 from me.
 I don't think we need to keep backward compatibility for this. PHP-6 is a 
major release, after all.

 It would be absolutely enough to add optional var-name conversion to 
extract()

 any word from anybody on the development team to say if this removal of
 dot conversion (whether optional or not) can be added to some todo list
 or suchlike and rolled out at some point soon~ish?


An (out of date) ToDo list is at http://wiki.php.net/todo/php60
Could you create an RFC at http://wiki.php.net/rfc to capture all the
discussion on the topic?

--
Blog: http://blogs.oracle.com/opal
Twitter:  http://twitter.com/ghrd

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread jvlad

 For BC, I suppose PHP could have *both* 'a.b' and 'a_b', or yet
 another php.ini flag (sorry!) to choose the behaviour.

-1 from me.
I don't think we need to keep backward compatibility for this. PHP-6 is a 
major release, after all.

It would be absolutely enough to add optional var-name conversion to 
extract()=

By default extract _ignores_ variables with dots like a.b
Even though register_globals should be removed, it does not mean that the 
default behaviour of extract
should be changed.
If it's _necessary_ to provide a way to mimic register_globals 
functionality, a special flag for it should
be added, something like EXTR_MIMIC_REGISTER_GLOBALS that will replaces 
incorrect characters
in the variable names with underscrores.
In this case BC won't be broken.



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [PATCH] PDO DBLIB

2010-01-21 Thread Niel Archer
 Stanley Sufficool wrote:
  I have tried to contact the maintainers of PDO with this, but have yet
  to get a response. Can I get this reviewed and if possible commited?
  
  Fixes BUG # 50755:
  http://bugs.php.net/bug.php?id=50755edit=1
  
  Compiled and tested with PHP SVN 5.2
 
 PDO development has it's own list ;)
 p...@lists.php.net

although joining it seems impossible ;-) Using the page here
http://www.php.net/mailing-lists.php to try joining the PDO list gets
the usual A request has been entered into the mailing list processing
queue. You should receive an email at m...@example.com shortly describing
how to complete your request. however the mail never arrives. No such
problem with the other lists though. It's been this way for some time
now.

 Although no doubt someone will pick it up from here ...
 
 -- 
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk
 EnquirySolve - http://enquirysolve.com/
 Model Engineers Digital Workshop - http://medw.co.uk//
 Firebird - http://www.firebirdsql.org/index.php
 
 -- 
 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] Re: [PHP-WEBMASTER] Re: wiki/windows.php.net system update

2010-01-21 Thread steve
Yeah, pecl for windows was last working in 2008 -- a couple of years
ago. Time flies...

Pierre, could you build a php_memcache-5.2-nts-Win32-vc9. It would be
much appreciated!

Thanks,
iamstever

On Sun, Jan 10, 2010 at 8:24 AM, Pierre Joye pierre@gmail.com wrote:
 On Sun, Jan 10, 2010 at 4:37 PM, pan p...@syix.com wrote:
 Pierre Joye wrote:
 hi,

 The wiki.php.net and windows.php.net box is being updated. The sites
 will be back online asap.



 Has it been a full year since PECL for Windows was to be ready?

 Just asking.

 Btw, many popular exts are frequently updated and available here:
 http://downloads.php.net/pierre/

 Cheers,
 --
 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 Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [PATCH] PDO DBLIB

2010-01-21 Thread Niel Archer
  Stanley Sufficool wrote:
   I have tried to contact the maintainers of PDO with this, but have yet
   to get a response. Can I get this reviewed and if possible commited?
   
   Fixes BUG # 50755:
   http://bugs.php.net/bug.php?id=50755edit=1
   
   Compiled and tested with PHP SVN 5.2
  
  PDO development has it's own list ;)
  p...@lists.php.net
 
 although joining it seems impossible ;-) Using the page here
 http://www.php.net/mailing-lists.php to try joining the PDO list gets
 the usual A request has been entered into the mailing list processing
 queue. You should receive an email at m...@example.com shortly describing
 how to complete your request. however the mail never arrives. No such
 problem with the other lists though. It's been this way for some time
 now.

Well whaddya-know! This time it worked for me, although 45 minutes wait
seems long. I'd given up 20 minutes after the other requests had been
answered.

  Although no doubt someone will pick it up from here ...
  
  -- 
  Lester Caine - G8HFL
  -
  Contact - http://lsces.co.uk/wiki/?page=contact
  L.S.Caine Electronic Services - http://lsces.co.uk
  EnquirySolve - http://enquirysolve.com/
  Model Engineers Digital Workshop - http://medw.co.uk//
  Firebird - http://www.firebirdsql.org/index.php
  
  -- 
  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



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [PATCH] PDO DBLIB

2010-01-21 Thread Stanley Sufficool
On Thu, Jan 21, 2010 at 8:32 PM, Niel Archer spam-f...@blueyonder.co.uk wrote:
  Stanley Sufficool wrote:
   I have tried to contact the maintainers of PDO with this, but have yet
   to get a response. Can I get this reviewed and if possible commited?
  
   Fixes BUG # 50755:
   http://bugs.php.net/bug.php?id=50755edit=1
  
   Compiled and tested with PHP SVN 5.2
 
  PDO development has it's own list ;)
  p...@lists.php.net

 although joining it seems impossible ;-) Using the page here
 http://www.php.net/mailing-lists.php to try joining the PDO list gets
 the usual A request has been entered into the mailing list processing
 queue. You should receive an email at m...@example.com shortly describing
 how to complete your request. however the mail never arrives. No such
 problem with the other lists though. It's been this way for some time
 now.

 Well whaddya-know! This time it worked for me, although 45 minutes wait
 seems long. I'd given up 20 minutes after the other requests had been
 answered.

Sent my request 2 days ago, still no answer. I will try again.

The PDO list has had no activity for about 2 months and the listed PDO
devs do not respond to e-mails. PHP says to send patches to the devs,
but this seems to be a no-go.


  Although no doubt someone will pick it up from here ...
 
  --
  Lester Caine - G8HFL
  -
  Contact - http://lsces.co.uk/wiki/?page=contact
  L.S.Caine Electronic Services - http://lsces.co.uk
  EnquirySolve - http://enquirysolve.com/
  Model Engineers Digital Workshop - http://medw.co.uk//
  Firebird - http://www.firebirdsql.org/index.php
 
  --
  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



 --
 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] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Victor Bolshov
 And I'm not sure who would actually use 'a.b' and then expect 'a_b',
 but I have to assume somebody has done that, perhaps consuming an API
 from somewhere else.

OpedID protocol uses dots in query string arguments. The
implementations could be broken by the patch.

While the keep arguments as is behaviour is certainly better in the
long run - issues like OpenID should be taken into account.

2010/1/21 jvlad d...@yandex.ru:

 For BC, I suppose PHP could have *both* 'a.b' and 'a_b', or yet
 another php.ini flag (sorry!) to choose the behaviour.

-1 from me.
I don't think we need to keep backward compatibility for this. PHP-6 is a
major release, after all.

It would be absolutely enough to add optional var-name conversion to
extract()=

 By default extract _ignores_ variables with dots like a.b
 Even though register_globals should be removed, it does not mean that the
 default behaviour of extract
 should be changed.
 If it's _necessary_ to provide a way to mimic register_globals
 functionality, a special flag for it should
 be added, something like EXTR_MIMIC_REGISTER_GLOBALS that will replaces
 incorrect characters
 in the variable names with underscrores.
 In this case BC won't be broken.



 --
 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] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Stan Vassilev

And I'm not sure who would actually use 'a.b' and then expect 'a_b',
but I have to assume somebody has done that, perhaps consuming an API
from somewhere else.


OpedID protocol uses dots in query string arguments. The
implementations could be broken by the patch.

While the keep arguments as is behaviour is certainly better in the
long run - issues like OpenID should be taken into account.


Hi, 

PHP6 *is* the long run. 


Regards,
Stan Vassilev 


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php