- if (($hook = stream_resolve_include_path("pharext_install.php"))) {
- $callable = include $hook;
- if (is_callable($callable)) {
- $recv = $callable($this);
+ $this->cwd = getcwd();
+ $this->tmp = $this->tempname(basename(Phar::running(false)));
+
+ $phar = new Phar(Phar::running(false));
+ foreach ($phar as $entry) {
+ if (fnmatch("*.ext.phar*", $entry->getBaseName())) {
+ $temp = $this->newtemp($entry->getBaseName());
+ $phar->extractTo($temp, $entry->getFilename(), true);
+ $phars[$temp] = new Phar($temp."/".$entry->getFilename());
+ }
+ }
+ $phars[$this->tmp] = $phar;
+
+ foreach ($phars as $phar) {
+ if (($hook = $phar["pharext_install.php"])) {
+ $callable = include $phar["pharext_install.php"];
+ if (is_callable($callable)) {
+ $recv[] = $callable($this);
+ }