I think you mean https://symfony.com/installer , PHAR , which starts as follows:
#!/usr/bin/env php <?php if (class_exists('Phar')) { Phar::mapPhar('default.phar'); require 'phar://' . __FILE__ . '/symfony'; }
Conceptually speaking, PHAR archives are not too different from self-extracting ZIP files (in fact, ZIP is one of the supported internal formats). The archive contains :
A stub , which is a short PHP script that you can see.
manifest describing the contents of the archive
Archive with the content itself
Optional signature
The top-end is a regular PHP script, so the PHAR archive can work with a regular PHP interpreter, and not require a special executable file:
php foo.phar
This script block ends with __ HALT_COMPILER (); to ::
Prevent parsing the rest of the file and possibly execute it as PHP code (the main script does everything that is needed for the initial phase).
Fill in the __COMPILER_HALT_OFFSET__ constant __COMPILER_HALT_OFFSET__ that the PHAR library can easily find where the archived data begins.
Scenarios do three things:
- Determine if the Phar library is available on the computer.
- Upload the current file to the Phar archive and register a manifest with a description of the contents.
- Run the symfony script inside the archive, which is the actual installer code.
source share