php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58343 phar error message unclear with php stream wrappers
Submitted: 2008-09-14 09:31 UTC Modified: 2009-04-30 00:40 UTC
From: st2oo2ww at yahoo dot com Assigned: cellog (profile)
Status: Closed Package: phar (PECL)
PHP Version: 5.2.5 OS: gentoo linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: st2oo2ww at yahoo dot com
New email:
PHP Version: OS:

 

 [2008-09-14 09:31 UTC] st2oo2ww at yahoo dot com
Description:
------------
Phar-extension cant create "phars" from php_stream_wrapper sources.

Reproduce code:
---------------
//use simple stream from PEAR
include 'Stream/Var.php';
stream_wrapper_register( "var", "Stream_Var" );

$pkg_fname = 'temp.phar';

//create simple phar
$a = new Phar($pkg_fname);
$stub = '<?php __HALT_COMPILER();?>';
$a->setStub($stub);
$a['module.php'] = file_get_contents('module.php');

$fname_wrapped = 'var://GLOBALS/buf_io';
$buf_io = file_get_contents($pkg_fname);

$p = new Phar($fname_wrapped);

Expected result:
----------------
no UnexpectedValueException

Actual result:
--------------
UnexpectedValueException: Cannot create phar 'var://GLOBALS/buf_io', file extension (or combination) not recognised in /workdir/public_html/phar_test.php

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-14 09:55 UTC] steph dot fox at virgin dot net
Shorter reproduce case that doesn't require additional files:

<?php

$fname = 'file://buf_io.phar';
$p = new Phar($fname);

?>

I *think* this bug is bogus because a phar:// stream works, and that's the only one that should work for a Phar constructor? However the error message is very misleading.
 [2008-09-14 11:06 UTC] greg at chiaraquartet dot net
updated summary to reflect non-bogus bug.  Phar is strictly local files only.
 [2008-09-14 11:14 UTC] st2oo2ww at yahoo dot com
Thanks sfox and cellog for your early reply
Im sorry this is mistake. Stream_var not good for testing streams with phar. Now phar works with stream ok from my wrapper.
 [2009-04-30 00:40 UTC] greg at chiaraquartet dot net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC