Skip to content

Phar Alias Handling

Pre-release
Pre-release
Compare
Choose a tag to compare
@ohader ohader released this 04 Mar 19:45
· 53 commits to master since this release

Description

Releases v3.1.0 and v.2.1.0 aim to overcome drawbacks in Phar's alias resolving (either by Phar archives using Phar::setAlias() in meta-data or Phar::mapPhar() in stub code).

Merged pull-requests

Migration

In case custom Assertable interceptors have been used, path resolving has to be adjusted in order to make use of alias resolving features.

before - example in v3.0.1

$baseFile = Helper::determineBaseFile($path);

after - example in v3.1.0

$invocation = Manager::instance()->resolve($path);
$baseName = $invocation->getBaseName(); // previously called $baseFile

Open Issues

There have been reports about flaws using stream_select() and according stream_cast() in PharStreamWrapper. Since it was not possible to reproduce the behavior in an isolated scenario and specific platform requiresments were not clear, these aspects have not been covered by these releses - see #8 and #19 for details.

Features

  • added low-level Phar\Reader for stub & meta-data (incl. alias) and their model representations
  • added Resolver\PharInvocationResolver in order to resolve/handle alias names
  • added Interceptor\ConjunctionInterceptor for combining multiple interceptors
  • added Interceptor\PharMetaDataInterceptor for actually testing against insecure deserialization in meta-data of Phar archives