Fix autoloading and prioritize getting it as a dependency

Cette révision appartient à :
Stéphane Goetz 2016-07-29 08:55:08 +02:00 révisé par GitHub
Parent 06f0945cab
révision b9d99d1388
1 fichiers modifiés avec 5 ajouts et 5 suppressions

Voir le fichier

@ -1,15 +1,15 @@
<?php <?php
// Loaded as a dependency
if (file_exists(__DIR__ . '/../../../autoload.php')) {
return require_once __DIR__ . '/../../../autoload.php';
}
// Loaded in the project itself // Loaded in the project itself
if (file_exists(__DIR__ . '/../vendor/autoload.php')) { if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
return require_once __DIR__ . '/../vendor/autoload.php'; return require_once __DIR__ . '/../vendor/autoload.php';
} }
// Loaded as a dependency
if (file_exists(__DIR__ . '/../../../../autoload.php')) {
return require_once __DIR__ . '/../../../../autoload.php';
}
// Loaded in the project itself, when vendor isn't installed // Loaded in the project itself, when vendor isn't installed
if (file_exists(__DIR__ . '/../daux.phar')) { if (file_exists(__DIR__ . '/../daux.phar')) {
define('PHAR_DIR', __DIR__ . '/..'); define('PHAR_DIR', __DIR__ . '/..');