php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55143 Missing documentation for Phar::mount()
Submitted: 2011-07-06 01:44 UTC Modified: 2011-12-04 23:23 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: staff at pro-unreal dot de Assigned: frozenfire (profile)
Status: Closed Package: PHAR related
PHP Version: 5.3.6 OS: Ubuntu Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: staff at pro-unreal dot de
New email:
PHP Version: OS:

 

 [2011-07-06 01:44 UTC] staff at pro-unreal dot de
Description:
------------
Hi,

on the manual page for Phar::mount some information is missing that may confuse users when using this method.

1. Unlike unix mount it is not possible to mount an external location to an existing path inside the phar. $pharpath must not exist or mount will fail.

2. When calling from inside a phar it not only may be a relative path, it MUST be a relative path or mount will fail. Mounting to foreign pahr locations inside a phar is not possible.

---
From manual page: http://www.php.net/phar.mount%23Description
---


Test script:
---------------
<?php

$phar = new Phar('file.phar');
$phar->startBuffering();
$phar->addStub('<?php require_once "phar://file.phar/index.php"; __HALT_COMPILER();');
$phar->addEmptyDir('foo');
$phar->addFromString('index.php', '<?php
// This will Fail!
Phar::mount("foo", "/etc/foo");

// This Will also fail:
Phar::mount('phar:///home/www/some.other.phar/bar', '/tmp/info');
');
$phar->stopBuffering();

Expected result:
----------------
As documented I expected both mounts to work, but they don't

Actual result:
--------------
Code is throwing PharException

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-04 23:22 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=320391
Log: Changed pharpath parameter to indicate that the path must be relative, and must not already exist. Updated example to reflect that. Closes bug #55143.
 [2011-12-04 23:23 UTC] frozenfire@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 [2011-12-04 23:23 UTC] frozenfire@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 02:01:32 2024 UTC