Created
December 7, 2015 21:41
-
-
Save connordavison/f8882eb4c84462e01b39 to your computer and use it in GitHub Desktop.
PsySH bootstrap for finding the nearest autoloader. Doesn't pollute the global scope.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| call_user_func(function () { | |
| $autoloader = 'vendor/autoload.php'; | |
| do { | |
| if (is_readable($autoloader)) { | |
| require_once $autoloader; | |
| echo "Autoloader loaded: $autoloader.\n"; | |
| break; | |
| } | |
| $autoloader = '../' . $autoloader; | |
| } while (realpath($autoloader) !== '/'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment