aboutsummaryrefslogtreecommitdiff
path: root/src/phar-stub.php
blob: 58ee78e58868ec25e3e5890d5d5b4d1ad6c7033d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
if (!in_array('phar', stream_get_wrappers()) || !class_exists('Phar', false)) {
    echo "Phar extension not avaiable\n";
    exit(255);
}

$web = 'www/index.php';
$cli = 'bin/phar-bdrem.php';

function rewritePath($path)
{
    if ($path == '' || $path == '/') {
        return 'www/index.php';
    }
    return $path;
}

//Phar::interceptFileFuncs();
set_include_path(
    'phar://' . __FILE__
    . PATH_SEPARATOR . 'phar://' . __FILE__ . '/lib/'
);
Phar::webPhar(null, $web, null, array(), 'rewritePath');
include 'phar://' . __FILE__ . '/' . $cli;
__HALT_COMPILER();
?>