3c801301fceef945c1e5f269ddabae75e86db0d5
[bdrem.git] / src / phar-stub.php
1 <?php
2 if (!in_array('phar', stream_get_wrappers()) || !class_exists('Phar', false)) {
3     echo "Phar extension not avaiable\n";
4     exit(255);
5 }
6
7 $web = 'www/index.php';
8 $cli = 'bin/bdrem.php';
9
10 function rewritePath($path)
11 {
12     if ($path == '' || $path == '/') {
13         return 'www/index.php';
14     }
15     return $path;
16 }
17
18 //Phar::interceptFileFuncs();
19 set_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path());
20 Phar::webPhar(null, $web, null, array(), 'rewritePath');
21 include 'phar://' . __FILE__ . '/' . $cli;
22 __HALT_COMPILER();
23 ?>