Req #60896 [Com]: Provide a wrapper for pipe(2)

2012-10-02 Thread olav dot morken at uninett dot no
Edit report at https://bugs.php.net/bug.php?id=60896&edit=1

 ID: 60896
 Comment by: olav dot morken at uninett dot no
 Reported by:phihag at phihag dot de
 Summary:Provide a wrapper for pipe(2)
 Status: Open
 Type:   Feature/Change Request
 Package:POSIX related
 Operating System:   Unix
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Support for unnamed pipes are useful with pcntl_fork(). That would allow for 
easy communication between parent and child processes.

A workaround is to use socket_create_pair(). However, sockets are not as 
lightweight as pipes.


Previous Comments:

[2012-01-27 16:33:39] cataphr...@php.net

Note the most common use case is covered by proc_open


[2012-01-26 23:28:00] phihag at phihag dot de

Description:

Currently, there does not seem to be a way to create an anonymous pipe (which 
is 
particularily) via the pipe(2) system call. There should be a wrapper for pipe 
and optionally pipe2 in php. See 
http://pubs.opengroup.org/onlinepubs/009695399/functions/pipe.html for the 
POSIX 
spec.

Test script:
---
https://bugs.php.net/bug.php?id=60896&edit=1


[PHP-BUG] Req #53655 [NEW]: Improve speed of DOMNode::C14N() on large XML documents

2011-01-04 Thread olav dot morken at uninett dot no
From: 
Operating system: 
PHP version:  5.3.4
Package:  DOM XML related
Bug Type: Feature/Change Request
Bug description:Improve speed of DOMNode::C14N() on large XML documents

Description:

The C14N() function appears to have a runtime that is O(N^2) (or possibly
worse?) depending on input size, which means that it becomes very slow as
the input grows. For example, an input with around 196000 nodes takes about
290 seconds, while an input with 486000 nodes takes 2200 seconds.



Note that this problem only occurs when canonicalizing a subtree of the
docuemnt. If we canonicalize the whole document, it completes almost
immediately.



The problem is that canonicalization uses an XPath expression to find the
nodeset that should be canonicalized. Evaluation of the XPath expression
takes a lot of time as the input size grows, but the libxml2
xmlC14NDocSaveTo() function also has to do a lookup in the nodeset returned
by the XPath expression for every node it encounters.



I believe a better solution would be to do this like it is done in the
xmlsec library. This library use the xmlC14NExecute()-function instead,
which accepts a callback that determines whether a node should be included
in the result. This should make the speed of canonicalization linear with
the input size.



Test script:
---
load('some-large-xml-file.xml');

$start = microtime(TRUE);

$doc->documentElement->C14N(FALSE, FALSE);

echo "Done in " . (microtime(TRUE) - $start) . " seconds.\n";




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



#49490 [NEW]: XPath namespace prefix conflict

2009-09-07 Thread olav dot morken at uninett dot no
From: olav dot morken at uninett dot no
Operating system: Linux (Debian)
PHP version:  5.3.0
PHP Bug Type: DOM XML related
Bug description:  XPath namespace prefix conflict

Description:

When processing an XML document with namespaces, an XPath query for a node
with a different namespace but the same namespace prefix fails.

This appears to be a conflict between the XPath namespaces and the
document namespaces. It works if either:
- The prefix in the query is replaced with a prefix that doesn't
  exist in the document.
- If the prefix in the query matches the prefix in the document.

This was tested with:
- PHP 5.3 from debian experimental: 5.3.0-3
- libxml2 2.7.3.dfsg-2.1


Reproduce code:
---
$doc = new DOMDocument();
$doc->loadXML('');

$xp = new DOMXPath($doc);
$xp->registerNamespace('prefix', 'urn:b');

echo($xp->query('//prefix:root')->length . "\n");


Expected result:

It should not find the root node, since we ask for a node in a different
prefix. I.e. it should print '0'.



Actual result:
--
It finds the root node, i.e. it prints '1'.




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