Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Extract Signature and Phar

Compare
Choose a tag to compare
released this 22 Jul 22:47
· 43 commits to master since this release

With this release comes two new features:

  • Extract an existing phar without the extension.
  • Retrieve a phar's signature without the extension.

To extract a phar:

$extract = new Herrera\Box\Extract('my.phar', $stubSize);
$extract->go(__DIR__ . '/my/out/dir');

This feature is also integrated into StubGenerator, so that you may be able to execute a phar without the phar extension as well.

StubGenerator::create()
    ->extract(true)
    ->index('hello.php')
    ->generate();

Being able to execute the phar largely depends on how you designed your application.

To get a phar's signature:

$signature = Herrera\Box\Box::getSignature('my.phar');

The value returned is identical to the result of Phar->getSignature().