Bootstrap.php 554 B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. * Bootstrap for PhpSpreadsheet classes.
  4. */
  5. // This sucks, but we have to try to find the composer autoloader
  6. $paths = [
  7. __DIR__ . '/../vendor/autoload.php', // In case PhpSpreadsheet is cloned directly
  8. __DIR__ . '/../../../autoload.php', // In case PhpSpreadsheet is a composer dependency.
  9. ];
  10. foreach ($paths as $path) {
  11. if (file_exists($path)) {
  12. require_once $path;
  13. return;
  14. }
  15. }
  16. throw new \Exception('Composer autoloader could not be found. Install dependencies with `composer install` and try again.');