[PHP-BUG] Bug #52209 [NEW]: INPUT_ENV returns NULL for set variables (CLI)

2010-06-30 Thread c...@php.net
From: ch
Operating system: Linux
PHP version:  5.3.2
Package:  Filter related
Bug Type: Bug
Bug description:INPUT_ENV returns NULL for set variables (CLI)

Description:

This is almost the same as #49184 just that I tried INPUT_ENV instead of
INPUT_SERVER.



Test script:
---
$ cat foo.php 

http://bugs.php.net/bug.php?id=52209&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52209&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52209&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52209&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52209&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52209&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52209&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52209&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52209&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52209&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52209&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52209&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52209&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52209&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52209&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52209&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52209&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52209&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52209&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52209&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52209&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52209&r=mysqlcfg



[PHP-BUG] Req #52210 [NEW]: simplexml_load_file should give type hint to SimpleXMLElement in phpdoc

2010-06-30 Thread c...@php.net
From: ch
Operating system: *
PHP version:  5.3.2
Package:  SimpleXML related
Bug Type: Feature/Change Request
Bug description:simplexml_load_file should give type hint to SimpleXMLElement 
in phpdoc

Description:

The current phpdoc of simplexml_load_file() on 

  http://de3.php.net/manual/en/function.simplexml-load-file.php 

says:

  object simplexml_load_file  (  string $filename  [,  string $class_name =
"SimpleXMLElement"  [,  int $options = 0  [,  string $ns  [,  bool
$is_prefix = false   )



To aide auto-completion in IDEs it would be helpful if the documentation
would

be changed to

  SimpleXMLElement simplexml_load_file(...)



At least NetBeans seems to auto generate stub .php files from the online
documentation.








-- 
Edit bug report at http://bugs.php.net/bug.php?id=52210&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52210&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52210&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52210&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52210&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52210&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52210&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52210&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52210&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52210&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52210&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52210&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52210&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52210&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52210&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52210&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52210&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52210&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52210&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52210&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52210&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52210&r=mysqlcfg



[PHP-BUG] Req #52708 [NEW]: New PDO::quoteIdentifier($name) method

2010-08-26 Thread c...@php.net
From: ch
Operating system: 
PHP version:  5.3.3
Package:  PDO related
Bug Type: Feature/Change Request
Bug description:New PDO::quoteIdentifier($name) method

Description:

Sometimes it would be very useful to have a PDO::quoteIdentifier($name)
method

for the same reasons there already is a PDO::quote($name) method i.e.
because the quoting characters might be different among database engines
and to prevent SQL-Injection-Attacks.



Implementing it shouldn't be hard as the lower level DB engines provide a
corresponding function or if not, the ANSI SQL quoting character could be
used as fall-back.




-- 
Edit bug report at http://bugs.php.net/bug.php?id=52708&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52708&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52708&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52708&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52708&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52708&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52708&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52708&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52708&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52708&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52708&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52708&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52708&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52708&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52708&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52708&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52708&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52708&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52708&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52708&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52708&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52708&r=mysqlcfg



[PHP-BUG] Req #53042 [NEW]: SoapServer->handle() should optionally throw Exception

2010-10-11 Thread c...@php.net
From: ch
Operating system: any
PHP version:  5.3.3
Package:  SOAP related
Bug Type: Feature/Change Request
Bug description:SoapServer->handle() should optionally throw Exception

Description:

When using SoapServer->handle() an exception that is thrown somewhere in
the

handled object is immediately converted to a SoapFault and printed on
stdout.

There is no way to catch that exception and e.g. print a warning with its
stack trace to the server logfile.



It would be nice if e.g. SoapServer::__construct() would get an additional
option that tells handle to just pass Exceptions. It would then be up to
the

programmer to catch and handle them. Of course, for that to work there
would have to be a new API function that can output the exception with the
correct SOAP headers as currently soap_server_fault_ex() from soap.c does.



Test script:
---
-

Expected result:

-

Actual result:
--
-

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53042&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53042&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53042&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=53042&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53042&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53042&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53042&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=53042&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=53042&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=53042&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=53042&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=53042&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=53042&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=53042&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53042&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=53042&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=53042&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=53042&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=53042&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=53042&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=53042&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=53042&r=mysqlcfg



[PHP-BUG] Req #54502 [NEW]: Add support for the "BITS" datatype

2011-04-10 Thread c...@php.net
From: 
Operating system: 
PHP version:  trunk-SVN-2011-04-10 (SVN)
Package:  SNMP related
Bug Type: Feature/Change Request
Bug description:Add support for the "BITS" datatype

Description:

The SNMP command line tools are able to translate the numeric return values
for OIDs of the "BITS" datatype back to meaningful string values by parsing
the relevant parts of the MIB. The PHP functions currently seem unable to
do that.



I.e. in the following example I would like to get the string "notification"
or "set" as return value but only get "0" or "1". As there is no other
method to find and parse the MIB I'm left with hardcoding the values in the
PHP script:



$ snmptranslate -Td DISMAN-EVENT-MIB::mteEventActions

DISMAN-EVENT-MIB::mteEventActions

mteEventActions OBJECT-TYPE

  -- FROM   DISMAN-EVENT-MIB

  SYNTAXBITS {notification(0), set(1)} 



Test script:
---
>From commandline (mind the strange quotes, they're neccessary!):



$ snmpwalk -v2c -c private localhost
"DISMAN-EVENT-MIB::mteEventActions.\"_snmpd\".'_linkDown'"

DISMAN-EVENT-MIB::mteEventActions."_snmpd".'_linkDown' = BITS: 80
notification(0) 



With PHP:

snmp_set_valueretrieval(SNMP_VALUE_OBJECT);

$snmp = new SNMP(SNMP_VERSION_2C, 'localhost', 'private');

$x =
$snmp->get("DISMAN-EVENT-MIB::mteEventActions.\"_snmpd\".'_linkDown'");

var_dump($x);

var_dump(bin2hex($x->value));

I get:

object(stdClass)#190 (2) {

  ["type"]=> int(4)

  ["value"]=> string(1) "�"

}

string(2) "80"



The value is not even numerical, it has to be converted to 0x80 using
bin2hex()!



Expected result:

Maybe 



* the SNMP_VALUE_OBJECT representation object can be enhanced to include
alternative representations:



object(stdClass)#190 (2) {

  ["type"]=> int(4)

  ["value"]=> string(1) "�"

  ["bits_value"]=> string(15) "notification(0)"

}



* or the the snmp_set_enum_print() function is used to toggle BITS, too

* or a snmp_set_bits_print() function is introduced

* or a snmp_translate() function is introduced that returns the
"snmptranslate" output as PHP data structure




-- 
Edit bug report at http://bugs.php.net/bug.php?id=54502&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54502&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54502&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=54502&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54502&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54502&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54502&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=54502&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=54502&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=54502&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=54502&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=54502&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=54502&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=54502&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54502&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=54502&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=54502&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=54502&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=54502&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=54502&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=54502&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=54502&r=mysqlcfg



Bug #53870 [Com]: Problem with passing array elements as references in foreach

2011-04-16 Thread c...@php.net
Edit report at http://bugs.php.net/bug.php?id=53870&edit=1

 ID: 53870
 Comment by:     c...@php.net
 Reported by:lolbummer at gmail dot com
 Summary:Problem with passing array elements as references in
 foreach
 Status: Open
 Type:   Bug
 Package:Arrays related
 Operating System:   Mac OS X Snow Leopard
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Further testing reveals that an unset($foo); between the two seems to
fix the problem.


Previous Comments:

[2011-04-17 08:57:21] c...@php.net

I have a much simpler reproduction script for, I think the same error.



$array = array('foo', 'bar');

foreach ($array as &$foo) {

}

foreach ($array as $foo) {

  echo "$foo\n";

}



Expected result:



foo

bar



Actual result:

--

foo

foo



Note that simply making $foo a reference is not enough. It is the double
foreach on the same array, with the same variable that causes the
reference to be "stuck".


[2011-04-07 20:32:46] akhrulev at mail dot ru

I propose simplest testcase. It is reproduced on all my computers:

PHP 5.3.6 on Windows 7

PHP 5.3.5 on Windows XP

PHP 5.2.6 on Linux version 2.6.18-128.1.6.el5.centos.plus









Expected result:

Array

(

[0] => AAA

[1] => BB

[2] => C

)



Actual result:

Array

(

[0] => AAA

[1] => BB

[2] => BB

)


[2011-02-04 16:04:38] uldericofilho at gmail dot com

On PHP 5.3.5 on CentOS 5.5 - same result. Proof of concept below:



echo "Result\n";

$arr = array(1,2,3,4,5);

foreach($arr as &$a){

$a*=2;

}

foreach($arr as $a){

echo $a."\n";

}



echo str_repeat('-', 10)."\nExpected\n";



$arr = array(1,2,3,4,5);

$arr = array_map(function($v){

return $v*2;

}, $arr);

foreach($arr as $a){

echo $a."\n";

}


[2011-01-28 18:15:45] lolbummer at gmail dot com

Description:

I created an array of strings that would be typecast to integers, and
cast them using a foreach loop, passing each element by reference. 
After dumping the resulting array, it gave (somewhat) expected results,
though after dumping each element individually, it gave an unexpected
result on the last element.

This happened with PHP 5.3.5 on Mac OS X Snow Leopard, but did not
happen on a Debian system with PHP 5.2.6.

Test script:
---
 $element){

var_dump($key);

var_dump($element);

echo "\n";

}

?>

Expected result:

array(6) {

  [0]=>

  int(1)

  [1]=>

  int(2)

  [2]=>

  int(3)

  [3]=>

  int(5324)

  [4]=>

  int(435)

  [5]=>

  int(51)

}

int(0)

int(1)



int(1)

int(2)



int(2)

int(3)



int(3)

int(5324)



int(4)

int(435)



int(5)

int(51)



Actual result:
--
array(6) {

  [0]=>

  int(1)

  [1]=>

  int(2)

  [2]=>

  int(3)

  [3]=>

  int(5324)

  [4]=>

  int(435)

  [5]=>

  &int(51)

}

int(0)

int(1)



int(1)

int(2)



int(2)

int(3)



int(3)

int(5324)



int(4)

int(435)



int(5)

int(435)






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53870&edit=1


[PHP-BUG] Req #55312 [NEW]: Please change SNMP::VERSION_ constants to sensible values

2011-07-28 Thread c...@php.net
From: 
Operating system: 
PHP version:  5.4.0alpha2
Package:  SNMP related
Bug Type: Feature/Change Request
Bug description:Please change SNMP::VERSION_ constants to sensible values

Description:

Currently the SNMP::VERSION class constants have the following internal
values:

const integer SNMP::VERSION_1 = 0 ;
const integer SNMP::VERSION_2C = 1 ;
const integer SNMP::VERSION_2c = 1 ;
const integer SNMP::VERSION_3 = 3 ;

As PHP does not yet have the concept of Enums the documentation just says
that the first parameter has to be numeric so people will be tempted to
enter 1, 2 or 3 as paramter which results in hard to debug errors (it
mostly works just some OIDs do not).

Would there be any drawbacks if we change the internal values to 1, 2, 2,
3?
It's still Alpha so no Backward Compatibility problems.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=55312&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55312&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55312&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=55312&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55312&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55312&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55312&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=55312&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=55312&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=55312&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=55312&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=55312&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=55312&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=55312&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55312&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=55312&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=55312&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=55312&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=55312&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=55312&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=55312&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=55312&r=mysqlcfg



Req #54378 [Com]: Expose snmp_in/out/mib_toggle_options()

2011-07-28 Thread c...@php.net
Edit report at https://bugs.php.net/bug.php?id=54378&edit=1

 ID: 54378
 Comment by:     c...@php.net
 Reported by:ch at lathspell dot de
 Summary:Expose snmp_in/out/mib_toggle_options()
 Status: Feedback
 Type:   Feature/Change Request
 Package:SNMP related
 PHP Version:trunk-SVN-2011-03-24 (SVN)
 Block user comment: N
 Private report: N

 New Comment:

Thanks, that should do it.


Previous Comments:

[2011-07-18 17:02:26] lytbo...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz

For Windows:

  http://windows.php.net/snapshots/

I've added noOIDIncreasingCheck property. When set to true, walk method works 
exactly as snmpwalk with -Cc flag.


[2011-03-24 22:30:27] ch at lathspell dot de

Description:

The snmpcmd(1) man page lists a lot of options, some of them should
probably be better done in PHP but some, like -Pc or -Cc could be
necessary in rare cases. An alternative would be to expose the "-Y"
function netsnmp_config_remember().

Of course it should be documented that these function alter the
global behaviour and not just the current session. Also that they
are Net-SNMP specific.

Test script:
---
-

Expected result:

-

Actual result:
--
-






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=54378&edit=1


Req #42918 [Com]: IPv6 addresses not supported in SNMP extension

2011-07-28 Thread c...@php.net
Edit report at https://bugs.php.net/bug.php?id=42918&edit=1

 ID: 42918
 Comment by:     c...@php.net
 Reported by:estesp at fastmail dot us
 Summary:IPv6 addresses not supported in SNMP extension
 Status: Open
 Type:   Feature/Change Request
 Package:SNMP related
 Operating System:   Linux
 PHP Version:5CVS-2007-10-10 (snap)
 Block user comment: N
 Private report: N

 New Comment:

Ping! This is 2011 and IPv6 spreading!

Fixing this issue shouldn't be very hard as the underlying Net_SNMP library 
already supports IPv6:

  $ snmpwalk -v 2c -c public 'udp6:[::1]' sysname
  SNMPv2-MIB::sysName.0 = STRING: james
 
  $ snmpwalk -v 2c -c public 'udp6:::1' sysname
  SNMPv2-MIB::sysName.0 = STRING: james

For testing the following hast to be put into /etc/snmp/snmpd.conf:

   agentAddress  udp:127.0.0.1:161,udp6:[::1]:161
   rwcommunity6 private ::1
   rocommunity6 public ::1

Currently PHP still gives the following error:
   $ ~/workspace/php-src-5.4/sapi/cli/php -r 'echo snmpget("::1", "private", 
"IF-MIB::ifAlias.1");'

   Warning: snmpget(): Could not open snmp connection: Unknown host (::1) 
(Illegal seek) in Command line code on line 1

Different formats like "[::1]:161" or "::1:161" make no difference.


Previous Comments:

[2010-04-14 14:39:00] j dot ek at gmx dot net

Actually the code mentioned above occurs two times. First time in function 
"php_snmpv3" (for SNMPv3) and second in "php_snmp" (for v1 and v2c).

It also seems that some other things should be updated to support IPv6 
addresses, e.g. not only support IpAddress SMIv2 Base Type but also the more 
generic address schema described in RFC3291. On the other hand I cannot say 
whether the net-snmp library already does support this, but as they claim to be 
fully IPv6 compatible, it's worth a try.


[2007-10-10 14:39:20] estesp at fastmail dot us

Description:

The snmp interface code in php5 does not properly support IPv6 addresses for 
the hostname.  Since net-snmp 5.x the SNMP daemon can be listening on udp6 port 
and therefore, the hostname passed could be a valid IPv6 address.

However, the code in the snmp extension has:

 if ((pptr = strchr (hostname, ':'))) {
remote_port = strtol (pptr + 1, NULL, 0);
}

So, instead of defaulting to the usual (default) snmp port, given an IPv6 
address, it is taking everything past the first colon as the port number.. 
which, I believe is going to give a very interesting port number for most IPv6 
addresses :)

Reproduce code:
---
Just call snmpget() with an IPv6 IP address.. you will get a host not found, or 
similar:

$host = ':::::::0001';
$community = 'public';
$sysName = snmpget($host, $community, "system.sysName.0");
print "$sysName

Expected result:

snmpget() should work for IPv6 addresses given you have a net-snmp version with 
IPv6 support and have snmpd listening on an IPv6 transport.

Actual result:
--
PHP Warning:  snmpget(): Could not open snmp connection: Unknown host
(:::::::0001) in /my_ipv6_php on line 4

There may be other issues here as "unknown host" sounds like a getaddrinfo 
problem, but since doing an snmpget on the server in Ipv6 mode outside of php5 
works, I have to bet that something in the snmp interface in php5 is broken 
with respect to IPv6.






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=42918&edit=1


Req #42918 [Com]: IPv6 addresses not supported in SNMP extension

2011-08-21 Thread c...@php.net
Edit report at https://bugs.php.net/bug.php?id=42918&edit=1

 ID: 42918
 Comment by:     c...@php.net
 Reported by:estesp at fastmail dot us
 Summary:IPv6 addresses not supported in SNMP extension
 Status: Feedback
 Type:   Feature/Change Request
 Package:SNMP related
 Operating System:   Linux
 PHP Version:5CVS-2007-10-10 (snap)
 Assigned To:lytboris
 Block user comment: N
 Private report: N

 New Comment:

Now it works, thanks!

Attached you find a diff that adds two basic tests for "udp6[::1]" as hostname.


Previous Comments:

[2011-08-20 20:55:55] lytbo...@php.net

Automatic comment from SVN on behalf of lytboris
Revision: http://svn.php.net/viewvc/?view=revision&revision=315245
Log: IPv6 Support for SNMP. (FR #42918)


[2011-08-20 16:24:43] lytbo...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




[2011-08-20 16:24:12] lytbo...@php.net

Automatic comment from SVN on behalf of lytboris
Revision: http://svn.php.net/viewvc/?view=revision&revision=315238
Log: document FR #55312, #42918


[2011-08-20 16:10:41] lytbo...@php.net

Automatic comment from SVN on behalf of lytboris
Revision: http://svn.php.net/viewvc/?view=revision&revision=315237
Log: merge from trunk two commits:
Adding IPv6 support (FR #42918)
more code coverage


[2011-08-20 15:53:36] lytbo...@php.net

Automatic comment from SVN on behalf of lytboris
Revision: http://svn.php.net/viewvc/?view=revision&revision=315236
Log: Adding IPv6 support (FR #42918)




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=42918


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=42918&edit=1


Req #42918 [PATCH]: IPv6 addresses not supported in SNMP extension

2011-08-21 Thread c...@php.net
Edit report at https://bugs.php.net/bug.php?id=42918&edit=1

 ID: 42918
 Patch added by:     c...@php.net
 Reported by:estesp at fastmail dot us
 Summary:IPv6 addresses not supported in SNMP extension
 Status: Feedback
 Type:   Feature/Change Request
 Package:SNMP related
 Operating System:   Linux
 PHP Version:5CVS-2007-10-10 (snap)
 Assigned To:lytboris
 Block user comment: N
 Private report: N

 New Comment:

The following patch has been added/updated:

Patch Name: php_bug42918.diff
Revision:   1313969737
URL:
https://bugs.php.net/patch-display.php?bug=42918&patch=php_bug42918.diff&revision=1313969737


Previous Comments:

[2011-08-21 23:34:20] c...@php.net

Now it works, thanks!

Attached you find a diff that adds two basic tests for "udp6[::1]" as hostname.


[2011-08-20 20:55:55] lytbo...@php.net

Automatic comment from SVN on behalf of lytboris
Revision: http://svn.php.net/viewvc/?view=revision&revision=315245
Log: IPv6 Support for SNMP. (FR #42918)


[2011-08-20 16:24:43] lytbo...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




[2011-08-20 16:24:12] lytbo...@php.net

Automatic comment from SVN on behalf of lytboris
Revision: http://svn.php.net/viewvc/?view=revision&revision=315238
Log: document FR #55312, #42918


[2011-08-20 16:10:41] lytbo...@php.net

Automatic comment from SVN on behalf of lytboris
Revision: http://svn.php.net/viewvc/?view=revision&revision=315237
Log: merge from trunk two commits:
Adding IPv6 support (FR #42918)
more code coverage




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=42918


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=42918&edit=1


Req #48430 [Com]: Missing snmpbulkset function

2011-08-21 Thread c...@php.net
Edit report at https://bugs.php.net/bug.php?id=48430&edit=1

 ID: 48430
 Comment by:     c...@php.net
 Reported by:ch at lathspell dot de
 Summary:Missing snmpbulkset function
 Status: Feedback
 Type:   Feature/Change Request
 Package:SNMP related
 PHP Version:5.2.9
 Assigned To:lytboris
 Block user comment: N
 Private report: N

 New Comment:

The OO API works great, good work, bug can be closed.


Previous Comments:

[2011-08-21 08:04:47] lytbo...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Try new OO API, it has bulk-set functionality.


[2009-05-29 15:17:54] ch at lathspell dot de

Description:

There seems to be no "snmpset" function for sending multiple "OID type value" 
pairs in one PDU packet. Sadly some crappy hardware needs this. It is possible 
with /usr/bin/snmpset so the underlying Net-SNMP library can handle it. (It 
might be called snmp bulk set analog to "SNMP bulk get" but I'm not sure if 
that's the same)







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=48430&edit=1


[PHP-BUG] Bug #55478 [NEW]: FILTER_VALIDATE_EMAIL fails with valid addresses containing "--" twice

2011-08-22 Thread c...@php.net
From: ch
Operating system: any
PHP version:  5.4.0alpha3
Package:  Filter related
Bug Type: Bug
Bug description:FILTER_VALIDATE_EMAIL fails with valid addresses containing 
"--" twice

Description:

The FILTER_VALIDATE_EMAIL check fails with valid adresses that contain "--"
twice because they have e.g. a German Umlaut ("ä") after a dash ("-").

The following examples can be verified using the converter tool on the
DeNIC page at
http://www.denic.de/domains/internationalized-domain-names/idn-konvertierung.html

 IDN: example-ä.de
 ACE-String: xn--example--7za.de


Test script:
---
--TEST--
Bug #X (FILTER_VALIDATE_EMAIL fails with valid addresses containing
"--" twice)
--FILE--

--EXPECTF--
%unicode|string%(21) "t...@xn--example--7za.de"


Expected result:

"t...@xn--example--7za.de"

Actual result:
--
bool(false)

$ TEST_PHP_EXECUTABLE=/home/chammers/workspace/php-src-5.4/sX.phpt /php
./run-tests.php ext/filter/tests/bugX

=
PHP : /home/chammers/workspace/php-src-5.4/sapi/cli/php 
PHP_SAPI: cli
PHP_VERSION : 5.4.0beta1-dev
ZEND_VERSION: 2.4.0
PHP_OS  : Linux - Linux sys-251 2.6.38-bpo.2-686 #1 SMP Tue Jun 14
11:43:18 UTC 2011 i686
INI actual  : /home/chammers/workspace/php5/php5-5.3.3
More .INIs  :  
CWD : /home/chammers/workspace/php5/php5-5.3.3
Extra dirs  : 
VALGRIND: Not used
=
Running selected tests.
FAIL Bug #X (FILTER_VALIDATE_EMAIL fails with valid addresses
containing "--" twice) [ext/filter/tests/bugX.phpt] 


-- 
Edit bug report at https://bugs.php.net/bug.php?id=55478&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55478&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55478&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=55478&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55478&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55478&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55478&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=55478&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=55478&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=55478&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=55478&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=55478&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=55478&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=55478&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55478&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=55478&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=55478&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=55478&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=55478&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=55478&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=55478&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=55478&r=mysqlcfg



[PHP-BUG] Req #55542 [NEW]: SNMP class should use Exceptions instead of PHP Errors

2011-08-30 Thread c...@php.net
From: ch
Operating system: 
PHP version:  5.4.0alpha3
Package:  SNMP related
Bug Type: Feature/Change Request
Bug description:SNMP class should use Exceptions instead of PHP Errors

Description:

Hello

Subject says all, IMHO it does not make sense to start writing a new class
that does not use 100% exceptions.

This bug is a follow up on #40816 which ended with:

 [2011-08-30 15:18 UTC] lytbo...@php.net

> I have read a bunch of threads on php-dev about extensions throwing
exceptions and the last thing I remember that extension should not throw
any exception except object creation if there is no way to disable them.

> Anyway, if to throw exceptions, library will throw an exception for each
error, not only parsing error.


Please, please, convinced yourself that Exceptions are cool and worth
refactoring the code. I'd be willing to help with writing tests :)

I'd be curious about the threads you mentioned (a quick google found
nothing but then the keywords are very common) but there are already some
extensions (spl/php_spl.c, mysql/php_mysql.c, reflection/php_reflection.c)
that do throw Exceptions.



-- 
Edit bug report at https://bugs.php.net/bug.php?id=55542&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55542&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55542&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=55542&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55542&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55542&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55542&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=55542&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=55542&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=55542&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=55542&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=55542&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=55542&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=55542&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55542&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=55542&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=55542&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=55542&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=55542&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=55542&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=55542&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=55542&r=mysqlcfg



Req #40816 [Com]: Add "snmptranslate" function

2011-08-30 Thread c...@php.net
Edit report at https://bugs.php.net/bug.php?id=40816&edit=1

 ID: 40816
 Comment by:     c...@php.net
 Reported by:ch at westend dot com
 Summary:Add "snmptranslate" function
 Status: Feedback
 Type:   Feature/Change Request
 Package:SNMP related
 Operating System:   linux
 PHP Version:5.2.1
 Assigned To:lytboris
 Block user comment: N
 Private report: N

 New Comment:

Well, throwing exceptions everywhere is exactly what I'd with for but to 
discuss this I opened #55542. This one can be closed as we now have a way to 
check for the presence of a MIB (more or less convenient).


Previous Comments:

[2011-08-30 15:18:14] lytbo...@php.net

I have read a bunch of threads on php-dev about extensions throwing exceptions 
and the last thing I remember that extension should not throw any exception 
except object creation if there is no way to disable them.

Anyway, if to throw exceptions, library will throw an exception for each error, 
not only parsing error.


[2011-08-30 15:10:48] ch at westend dot com

Now the following works..

  @$snmp->get(array($oid1, $oid2));
  if ($snmp->getErrno() == SNMP::ERRNO_OID_PARSING_ERROR) {
throw new Exception($snmp->getError());
  }

... but why is there only a warning? Calling get() with a OID that does not 
even parses should throw an Exception? Especially as when using OOP, one does 
not expect having to call getErrno() after every call as we did in the last 
millenium or even worse don't catch this error.

Can you wrapt this into a nice SnmpOidParsingException?


[2011-08-30 14:30:34] lytbo...@php.net

Indeed. Commited sources into PHP_5_4 branch.


[2011-08-30 09:52:01] ch at westend dot com

As of SVN revision 315762 from now, the constant only appears in the tests, not 
in the class source. Running the tests yield to:

Fatal error: Undefined class constant 'ERRNO_OID_PARSING_ERROR' in 
/home/chammers/workspace/php-src-5.4/ext/snmp/tests/snmp-object-errno-errstr.php
 on line 45

Maybe it's not yet committet?


[2011-08-30 09:42:08] lytbo...@php.net

Please check that you have ERRNO_OID_PARSING_ERROR in snmp extension sources. 
This constant appeared on 27th of august.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=40816


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=40816&edit=1


[PHP-BUG] Bug #55567 [NEW]: SoapFault is missing methods to get the Fault Code

2011-09-01 Thread c...@php.net
From: ch
Operating system: 
PHP version:  5.4.0alpha3
Package:  SOAP related
Bug Type: Bug
Bug description:SoapFault is missing methods to get the Fault Code

Description:

The SoapFault object does not have a getFaultCode() method nor does it set
the exception code to the received SOAP fault code.

The code is available through the undocumented public property "faultcode"
though.

I would suggest setting the Exception code to the SOAP fault code.
Backwards compatibility shouldn't be a big problem because currently, the
code can only be 0 as the constructor does not even makes it possible to
change it.

If you disagree, I'd like to see a getFaultCode() method at least.

Having access to the SOAP fault code is essential as SOAP does not transfer
the Exception class name and thus there is no other way to cleanly
distinguish between different kinds of exceptions.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=55567&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55567&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55567&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=55567&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55567&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55567&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55567&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=55567&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=55567&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=55567&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=55567&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=55567&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=55567&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=55567&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55567&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=55567&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=55567&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=55567&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=55567&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=55567&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=55567&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=55567&r=mysqlcfg



[PHP-BUG] Bug #63657 [NEW]: pgsqlCopyFromFile, pgsqlCopyToArray have syntax errors

2012-11-30 Thread c...@php.net
From: ch
Operating system: 
PHP version:  5.4.9
Package:  PDO related
Bug Type: Bug
Bug description:pgsqlCopyFromFile, pgsqlCopyToArray have syntax errors

Description:

In ext/pdo_pgsql/pgsql_driver.c the methods pgsqlCopyToArray,
pgsqlCopyFromArray etc. all use the following syntax:

  COPY %s FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'

In at least PostgreSQL 9.2 this is a syntax error though. The correct
syntax is:

  COPY %s FROM STDIN WITH DELIMITER E'%c', NULL AS E'%s'

a) the "WITH" is optional but must come immediately after the STDIN if
given
b) it's a singular "DELIMITER", not plural


(btw, these method are undocumented anyway, see my other bug report about
that)


-- 
Edit bug report at https://bugs.php.net/bug.php?id=63657&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63657&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63657&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=63657&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=63657&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=63657&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63657&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=63657&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=63657&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=63657&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=63657&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63657&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63657&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=63657&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63657&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=63657&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=63657&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=63657&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63657&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63657&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63657&r=mysqlcfg