Be able to serve the website simply with the phar archive

This commit is contained in:
Stéphane Goetz 2015-07-19 12:40:49 +02:00
parent 932fab5a84
commit a7962839d0
2 changed files with 8 additions and 1 deletions

BIN
daux.phar

Binary file not shown.

View File

@ -75,7 +75,14 @@ if (php_sapi_name() === 'cli-server') {
$_SERVER['SCRIPT_NAME'] = '/index.php';
}
require_once("vendor/autoload.php");
if (file_exists('vendor/autoload.php')) {
require_once('vendor/autoload.php');
} elseif (file_exists('daux.phar')) {
define('PHAR_DIR', __DIR__);
require_once("phar://" . __DIR__ . "/daux.phar/vendor/autoload.php");
} else {
throw new Exception("Impossible to load Daux, missing vendor and phar");
}
\Todaymade\Daux\Daux::initConstants();