[PHP-CVS] com php-src: Revert NEWS: NEWS

2012-05-22 Thread Xinchen Hui
Commit:5b8316188c4fe209d191310a49aea9ac3fcd056a
Author:Xinchen Hui  Wed, 23 May 2012 13:52:18 
+0800
Parents:   df481764f34b0268025d031a082297edee124c7c
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5b8316188c4fe209d191310a49aea9ac3fcd056a

Log:
Revert NEWS

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index ba0b220..ad51a67 100644
--- a/NEWS
+++ b/NEWS
@@ -50,10 +50,6 @@ PHP  
  NEWS
 - Pgsql:
   . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
 
-- Reflection:
-  . Implemented FR #61602 (Allow access to the name of constant
-used as function/method parameter's default value). (reeze@gmail.com)
-
 - Fileinfo
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
 (Laruence, Gustavo)


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Revert "Implemented FR #61602 Allow access to name of constant used as default value": ext/reflection/php_reflection.c ext/reflection/tests/ReflectionParameter_DefaultValueConst

2012-05-22 Thread Xinchen Hui
Commit:df481764f34b0268025d031a082297edee124c7c
Author:Xinchen Hui  Wed, 23 May 2012 13:50:12 
+0800
Parents:   29876c5c29e737158ecfeb32a59b5bfb0607723b
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=df481764f34b0268025d031a082297edee124c7c

Log:
Revert "Implemented FR #61602 Allow access to name of constant used as default 
value"

This reverts commit 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74.

See: http://news.php.net/php.cvs/69137 and the author confirmed.
Will commit later after the author fixed this then make a new PR.

Conflicts:

ext/reflection/php_reflection.c

Bugs:
https://bugs.php.net/61602

Changed paths:
  M  ext/reflection/php_reflection.c
  D  ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt
  D  ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt
  D  ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt

diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 406da93..1cf65ce 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1457,49 +1457,6 @@ static void 
_reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
 }
 /* }}} */
 
-/* {{{ _reflection_param_get_default_param */
-static parameter_reference 
*_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS)
-{
-   reflection_object *intern;
-   parameter_reference *param;
-
-   GET_REFLECTION_OBJECT_PTR(param);
-
-   if (param->fptr->type != ZEND_USER_FUNCTION)
-   {
-   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Cannot determine default value for internal functions");
-   return NULL;
-   }
-
-   if (param->offset < param->required) {
-   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Parameter is not optional");
-   return NULL;
-   }
-
-   return param;
-}
-/* }}} */
-
-/* {{{ _reflection_param_get_default_precv */
-static zend_op 
*_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS, 
parameter_reference *param)
-{
-   zend_op *precv;
-
-   param = param ? param : 
_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-   if (!param) {
-   return NULL;
-   }
-
-   precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
-   if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == 
IS_UNUSED) {
-   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Internal error");
-   return NULL;
-   }
-
-   return precv;
-}
-/* }}} */
-
 /* {{{ Preventing __clone from being called */
 ZEND_METHOD(reflection, __clone)
 {
@@ -2578,14 +2535,27 @@ ZEND_METHOD(reflection_parameter, 
isDefaultValueAvailable)
Returns the default value of this parameter or throws an exception */
 ZEND_METHOD(reflection_parameter, getDefaultValue)
 {
-   parameter_reference *param =  
_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-   zend_op *precv = 
_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param);
+   reflection_object *intern;
+   parameter_reference *param;
+   zend_op *precv;
 
if (zend_parse_parameters_none() == FAILURE) {
return;
}
+   GET_REFLECTION_OBJECT_PTR(param);
 
-   if (!(param && precv)) {
+   if (param->fptr->type != ZEND_USER_FUNCTION)
+   {
+   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Cannot determine default value for internal functions");
+   return;
+   }
+   if (param->offset < param->required) {
+   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Parameter is not optional");
+   return;
+   }
+   precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
+   if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == 
IS_UNUSED) {
+   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Internal error");
return;
}
 
@@ -2598,42 +2568,6 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
 }
 /* }}} */
 
-/* {{{ proto public bool ReflectionParameter::isDefaultValueConstant()
-   Returns whether the default value of this parameter is constant */
-ZEND_METHOD(reflection_parameter, isDefaultValueConstant)
-{
-   zend_op *precv = 
_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, NULL);
-
-   if (zend_parse_parameters_none() == FAILURE) {
-   return;
-   }
-
-   if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == 
IS_CONSTANT) {
-   RETURN_TRUE;
-   }
-
-   RETURN_FALSE;
-}
-/* }}} */
-
-/* {{{ proto public mixed ReflectionParameter::getDefaultValueConstantName()
-   Returns the default value's constant name if default va

[PHP-CVS] com php-src: Fix typo while resolving conflicts: ext/reflection/php_reflection.c

2012-05-22 Thread Xinchen Hui
Commit:f733173b1f70acec4f124f3c8e9dc1b3fb422413
Author:Xinchen Hui  Wed, 23 May 2012 13:43:49 
+0800
Parents:   a7df6ce664e6fe8601531d90318082bb6597
Branches:  PHP-5.3

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f733173b1f70acec4f124f3c8e9dc1b3fb422413

Log:
Fix typo while resolving conflicts

Changed paths:
  M  ext/reflection/php_reflection.c


Diff:
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index fe65731..8141275 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2413,7 +2413,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
return;
}
precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
-   if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == 
IS_UNUSED) {
+   if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == 
IS_UNUSED) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Internal error");
return;
}


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Revert "Implemented FR #61602 Allow access to name of constant used as default value": ext/reflection/php_reflection.c

2012-05-22 Thread Xinchen Hui
Commit:a7df6ce664e6fe8601531d90318082bb6597
Author:Xinchen Hui  Wed, 23 May 2012 13:39:00 
+0800
Parents:   621fddab93468219aafb0392c7056e551defa1fa
Branches:  PHP-5.3

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a7df6ce664e6fe8601531d90318082bb6597

Log:
Revert "Implemented FR #61602 Allow access to name of constant used as default 
value"

This reverts commit 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74.

See: http://news.php.net/php.cvs/69137 and the author confirmed.
Will commit later after the author fixed this then make a new PR.

Conflicts:

ext/reflection/php_reflection.c

Bugs:
https://bugs.php.net/61602

Changed paths:
  M  ext/reflection/php_reflection.c


Diff:
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 522fef1..fe65731 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2409,12 +2409,12 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
return;
}
if (param->offset < param->required) {
-   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Parameter is not optional"); 
+   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Parameter is not optional");
return;
}
precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
-   if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == 
IS_UNUSED) {
-   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Internal error"); 
+   if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == 
IS_UNUSED) {
+   zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Internal error");
return;
}


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] 回复: com php-src: Implemented FR #61602 Allow access to name of constant used as

2012-05-22 Thread Laruence
Hi:

I am going to  revert this , please make a new PR after you fix this. :)

thanks

On Wed, May 23, 2012 at 11:55 AM, Reeze  wrote:
> Hi, Nuno,
> Thanks for reminding, I've attached a patch for this. could you take a look?
> GET_REFLECTION_OBJECT_PTR used widely, but define yet another macro seems
> useless, so I expand the macro.
>
> Thanks.
>
> Best
> --
> reeze | reeze.cn
>
> 在 2012年5月23日星期三,上午2:50,Nuno Lopes 写道:
>
> Commit: 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74
> Author: reeze  Tue, 3 Apr 2012 13:47:16 +0800
> Parents: 3bf53aa911e1e2128a11aee45c126000635de006
> Branches: PHP-5.4 master
>
> Link:
> http://git.php.net/?p=php-src.git;a=commitdiff;h=054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74
>
> Log:
> Implemented FR #61602 Allow access to name of constant used as default value
>
> Bugs:
> https://bugs.php.net/61602
>
> diff --git a/ext/reflection/php_reflection.c
> b/ext/reflection/php_reflection.c
> index 1cf65ce..ef1ed7e 100644
> --- a/ext/reflection/php_reflection.c
> +++ b/ext/reflection/php_reflection.c
> @@ -1457,6 +1457,57 @@ static void
> _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
> }
> /* }}} */
> +/* {{{ _reflection_param_get_default_param */
> +static parameter_reference
> *_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS)
> +{
> + reflection_object *intern;
> + parameter_reference *param;
> +
> + if (zend_parse_parameters_none() == FAILURE) {
> + return NULL;
> + }
> +
> + GET_REFLECTION_OBJECT_PTR(param);
>
>
> You cannot use GET_REFLECTION_OBJECT_PTR here because it has a
> 'return;' statement (i.e., without a return value). While gcc accepts
> this (but issues a warning), it's considered an error in C99, and it
> breaks the build with other compilers.
> Please either fix it or revert the patch.
>
> Nuno
>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] 回复: com php-src: Implemented FR #61602 Allow access to name of constant used as

2012-05-22 Thread Reeze
Hi, Nuno,  
Thanks for reminding, I've attached a patch for this. could you take a look?
GET_REFLECTION_OBJECT_PTR used widely, but define yet another macro seems
useless, so I expand the macro.  

Thanks.

Best
--  
reeze | reeze.cn


在 2012年5月23日星期三,上午2:50,Nuno Lopes 写道:

> > Commit: 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74
> > Author: reeze mailto:reeze@gmail.com)> Tue, 3 Apr 
> > 2012 13:47:16 +0800
> > Parents: 3bf53aa911e1e2128a11aee45c126000635de006
> > Branches: PHP-5.4 master
> >  
> > Link:  
> > http://git.php.net/?p=php-src.git;a=commitdiff;h=054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74
> >  
> > Log:
> > Implemented FR #61602 Allow access to name of constant used as default value
> >  
> > Bugs:
> > https://bugs.php.net/61602
> >  
> > diff --git a/ext/reflection/php_reflection.c  
> > b/ext/reflection/php_reflection.c
> > index 1cf65ce..ef1ed7e 100644
> > --- a/ext/reflection/php_reflection.c
> > +++ b/ext/reflection/php_reflection.c
> > @@ -1457,6 +1457,57 @@ static void  
> > _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
> > }
> > /* }}} */
> > +/* {{{ _reflection_param_get_default_param */
> > +static parameter_reference  
> > *_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS)
> > +{
> > + reflection_object *intern;
> > + parameter_reference *param;
> > +
> > + if (zend_parse_parameters_none() == FAILURE) {
> > + return NULL;
> > + }
> > +
> > + GET_REFLECTION_OBJECT_PTR(param);
> >  
>  
>  
> You cannot use GET_REFLECTION_OBJECT_PTR here because it has a  
> 'return;' statement (i.e., without a return value). While gcc accepts  
> this (but issues a warning), it's considered an error in C99, and it  
> breaks the build with other compilers.
> Please either fix it or revert the patch.
>  
> Nuno  

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] Re: com php-src: Implemented FR #61602 Allow access to name of constant used as

2012-05-22 Thread Nuno Lopes

Commit:054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74
Author:reeze  Tue, 3 Apr 2012 13:47:16 +0800
Parents:   3bf53aa911e1e2128a11aee45c126000635de006
Branches:  PHP-5.4 master

Link:
http://git.php.net/?p=php-src.git;a=commitdiff;h=054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74


Log:
Implemented FR #61602 Allow access to name of constant used as default value

Bugs:
https://bugs.php.net/61602

diff --git a/ext/reflection/php_reflection.c  
b/ext/reflection/php_reflection.c

index 1cf65ce..ef1ed7e 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1457,6 +1457,57 @@ static void  
_reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c

 }
 /* }}} */
 +/* {{{ _reflection_param_get_default_param */
+static parameter_reference  
*_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS)

+{
+   reflection_object *intern;
+   parameter_reference *param;
+
+   if (zend_parse_parameters_none() == FAILURE) {
+   return NULL;
+   }
+
+   GET_REFLECTION_OBJECT_PTR(param);


You cannot use GET_REFLECTION_OBJECT_PTR here because it has a  
'return;' statement (i.e., without a return value). While gcc accepts  
this (but issues a warning), it's considered an error in C99, and it  
breaks the build with other compilers.

Please either fix it or revert the patch.

Nuno

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Fix bug #62109 tests\basic\bug46313-win.phpt fails: tests/basic/bug46313-win.phpt

2012-05-22 Thread Anatoliy Belsky
Commit:621fddab93468219aafb0392c7056e551defa1fa
Author:Anatoliy Belsky  Tue, 22 May 2012 18:41:03 
+0200
Parents:   faca4e08b4dffbf00b1bc20fc5d4e310b3f99c13
Branches:  PHP-5.3 PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=621fddab93468219aafb0392c7056e551defa1fa

Log:
Fix bug #62109 tests\basic\bug46313-win.phpt fails

Bugs:
https://bugs.php.net/62109
https://bugs.php.net/46313

Changed paths:
  M  tests/basic/bug46313-win.phpt


Diff:
diff --git a/tests/basic/bug46313-win.phpt b/tests/basic/bug46313-win.phpt
index 87786d4..350134e 100644
--- a/tests/basic/bug46313-win.phpt
+++ b/tests/basic/bug46313-win.phpt
@@ -6,6 +6,7 @@ Bug #46313 (Magic quotes broke $_FILES)
 magic_quotes_gpc=1
 file_uploads=1
 register_globals=1
+display_errors=0
 --POST_RAW--
 Content-Type: multipart/form-data; 
boundary=---20896060251896012921717172737
 -20896060251896012921717172737
@@ -26,19 +27,19 @@ var_dump($GLOBALS["o1\'file_name"]);
 var_dump($GLOBALS["o1\'file_name"] === $_FILES["o1\'file"]["name"]);
 var_dump($GLOBALS["o1\'file"]);
 var_dump($GLOBALS["o1\'file"] === $_FILES["o1\'file"]["tmp_name"]);
+/* The windows policy is walking to the last (single)quote in a file name and 
taking the remain.
+   This way some'file.gif becomes file.gif */
 ?>
 --EXPECTF--
-Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater 
in Unknown on line 0
-Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater 
in Unknown on line 0
 array(2) {
   ["o1\'file"]=>
   array(5) {
 ["name"]=>
-string(12) "o1"
+string(8) "file.png"
 ["type"]=>
 string(16) "text/plain-file1"
 ["tmp_name"]=>
-string(14) "%s"
+string(%d) "%s.tmp"
 ["error"]=>
 int(0)
 ["size"]=>
@@ -47,18 +48,18 @@ array(2) {
   ["o2\'file"]=>
   array(5) {
 ["name"]=>
-string(13) "o2"
+string(9) "file2.txt"
 ["type"]=>
 string(16) "text/plain-file2"
 ["tmp_name"]=>
-string(14) "%s"
+string(%d) "%s.tmp"
 ["error"]=>
 int(0)
 ["size"]=>
 int(1)
   }
 }
-string(12) "o1"
+string(8) "file.png"
 bool(true)
 string(%d) "%s"
 bool(true)


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] com php-src: - fix NEWS for bug #61812: NEWS

2012-05-22 Thread Jérôme Loyet
I really don't know what this is

I made a patch for 5.3 (sources + NEWS) with a commit
I made a patch for 5.4 (sources + NEWS) with a commit (I did not use merge,
it was 2 distinct commits)
I merge 5.4 into master
I push to origin

I've followed the git faq on the wiki (the config are all set correctly)

and now I don't understand why there is a modification of NEWS on master
while this file is not supposed to be merged between branches.

Is it just an impression of GIT is just over complicated ? god I miss svn :/

So if my commits are wrong, feel free to fix because I don't even know if
there's a problem or if it's all OK

thx
++ fat

2012/5/22 Jérôme Loyet 

> gnurf ? wtf ?
>
> I'm sorry guys for this NEWS modification on master. It was not supposed
> to be. I hate GIT ... it was so much clear and easy with SVN. I'll try to
> fix this but not sure to know how to ...
>
> ++ fat
>
>
> 2012/5/22 Jérôme Loyet 
>
>> Commit:d1e529c1cba17bed376833ab0a4c785a251abf02
>> Author:Jerome Loyet  Tue, 22 May 2012 08:38:09
>> +0200
>> Parents:   074d361d647b0fba334e5e14d3b6904ba1ea09d8
>> Branches:  master
>>
>> Link:
>> http://git.php.net/?p=php-src.git;a=commitdiff;h=d1e529c1cba17bed376833ab0a4c785a251abf02
>>
>> Log:
>> - fix NEWS for bug #61812
>>
>> Bugs:
>> https://bugs.php.net/61812
>>
>> Changed paths:
>>  M  NEWS
>>
>>
>> Diff:
>> diff --git a/NEWS b/NEWS
>> index 68f0a35..dd31dde 100644
>> --- a/NEWS
>> +++ b/NEWS
>> @@ -47,6 +47,9 @@ PHP
>>NEWS
>>  - Phar:
>>   . Fix bug #61065 (Secunia SA44335). (Rasmus)
>>
>> +- Pgsql:
>> +  . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
>> +
>>  - Reflection:
>>   . Implemented FR #61602 (Allow access to the name of constant
>> used as function/method parameter's default value). (
>> reeze@gmail.com)
>>
>>
>> --
>> PHP CVS Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>