Allow renaming of shpub.phar to shpub
[shpub.git] / src / phar-stub.php
1 #!/usr/bin/env php
2 <?php
3 /**
4  * Phar stub file for shpub. Handles startup of the .phar file.
5  *
6  * PHP version 5
7  *
8  * @author    Christian Weiske <cweiske@cweiske.de>
9  * @copyright 2016 Christian Weiske
10  * @license   http://www.gnu.org/licenses/agpl.html GNU AGPL v3
11  * @link      http://cweiske.de/shpub.htm
12  */
13 if (!in_array('phar', stream_get_wrappers()) || !class_exists('Phar', false)) {
14     echo "Phar extension not avaiable\n";
15     exit(255);
16 }
17
18 Phar::mapPhar('shpub.phar');
19 set_include_path(
20     'phar://' . __FILE__
21     . PATH_SEPARATOR . 'phar://' . __FILE__ . '/lib/'
22 );
23
24 require 'phar://' . __FILE__ . '/bin/phar-shpub.php';
25 __HALT_COMPILER();
26 ?>