daux.io/libs/bootstrap.php

34 lignes
786 B
PHP
Brut Lien permanent Vue normale Historique

<?php
function loadApp() {
// Loaded as a dependency
if (file_exists(__DIR__ . '/../../../autoload.php')) {
return require_once __DIR__ . '/../../../autoload.php';
}
// Loaded in the project itself
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
return require_once __DIR__ . '/../vendor/autoload.php';
}
2017-10-18 21:15:35 +02:00
throw new Exception('Impossible to load Daux, missing vendor/');
}
$loader = loadApp();
if ($loader) {
$ext = __DIR__ . '/../daux';
if (is_dir(getcwd() . "/daux")) {
$ext = getcwd() . "/daux";
}
$env = getenv('DAUX_EXTENSION');
if ($env && is_dir($env)) {
$ext = $env;
}
define('DAUX_EXTENSION', $ext);
$loader->setPsr4("Todaymade\\Daux\\Extension\\", $ext);
}