[php-maint] Bug#425377: php5-cli: stream_wrapper_restore() does not work

Sébastien Ducoulombier seb at ldd.fr
Mon May 21 10:19:09 UTC 2007


Package: php5-cli
Version: 5.2.0-8+etch4
Severity: normal

PHP5 standard method stream_wrapper_restore() always breaks.

stream_wrapper_unregister('zip');
stream_wrapper_restore('zip'); # triggers "Warning: stream_wrapper_restore(): zip:// never existed, nothing to restore"

libapache2-mod-php5 suffers the same bug.

Here is a more detailled test program :

#!/usr/bin/php
<?php
error_log("Original list of stream wrappers:");
error_log(print_r(stream_get_wrappers(), true));

$wrappers = stream_get_wrappers();
$w = $wrappers[0];

error_log("Unregistering the first one, '$w'...");
stream_wrapper_unregister($w);

error_log("Now '$w' was removed from the list of stream wrappers (fine):");
error_log(print_r(stream_get_wrappers(), true));

error_log("Restoring '$w' (won't work, this is the bug)...");
stream_wrapper_restore($w);

error_log("'$w' was not restored into the list of stream wrappers (wrong):");
error_log(print_r(stream_get_wrappers(), true));
?>

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (300, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.21.1fly (PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash




More information about the pkg-php-maint mailing list