daux.io/libs/bootstrap.php

21 lines
622 B
PHP
Raw Normal View History

<?php
// Loaded in the project itself
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
2016-07-28 22:48:50 +02:00
return require_once __DIR__ . '/../vendor/autoload.php';
}
// Loaded as a dependency
if (file_exists(__DIR__ . '/../../../../autoload.php')) {
2016-07-28 22:48:50 +02:00
return require_once __DIR__ . '/../../../../autoload.php';
}
// Loaded in the project itself, when vendor isn't installed
if (file_exists(__DIR__ . '/../daux.phar')) {
define('PHAR_DIR', __DIR__ . '/..');
2016-07-28 22:48:50 +02:00
return require_once 'phar://' . __DIR__ . '/../daux.phar/vendor/autoload.php';
}
2016-07-28 22:48:50 +02:00
throw new Exception('Impossible to load Daux, missing vendor/ or daux.phar');