I packed the PHP application into the Phar executable archive and there, inside the same class as the method, which should access the executed metadata of the Phar archive .
I could get the metadata as shown below, however it seems strange that I load the same Phar inside the Phar archive , executed to get the metadata.
So, is there a way to get completed meta data from Phar? Perhaps read it and determine what is inside the Phar Stub or something else.
<?php namespace MyPhar; use \Phar; class InsideThePhar { public function getPharMetaData() { $phar_self = new Phar(Phar::running(false)); $metadata = $phar_self->getMetadata(); var_dump($metadata); exit(); } }
source share