php-phpspec-prophecy/php-phpspec-prophecy-autoload.php
Shawn Iwinski 3f17460659 Prep for php-composer(phpdocumentor/reflection-docblock) changes
- Prepare for php-phpdocumentor-reflection-docblock =>
  php-phpdocumentor-reflection-docblock2 dependency rename
- Update autoloader to try loading newest
  php-composer(phpdocumentor/reflection-docblock), then try loading older v2,
  then trigger an error if neither are found in include path
2017-04-13 15:01:20 -04:00

27 lines
1.2 KiB
PHP

<?php
/* Autoloader for phpspec/prophecy and its dependencies */
// Rely on include_path as in PHPUnit dependencies + circular dependencies
require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Prophecy\\', __DIR__);
// Dependencies
require_once 'Doctrine/Instantiator/autoload.php';
if ($dep = stream_resolve_include_path('phpDocumentor/Reflection/DocBlock/autoload.php')) {
require_once $dep;
} else if ($dep = stream_resolve_include_path('phpDocumentor/Reflection/DocBlock2/autoload.php')) {
require_once $dep;
} else {
trigger_error('phpDocumentor reflection docblock autoloader not found in include path', E_USER_ERROR);
exit(1);
}
unset($dep);
if (!class_exists('SebastianBergmann\\Comparator\\Comparator')) { // v2 from phpunit, v1 from phpspec
require_once (stream_resolve_include_path('SebastianBergmann/Comparator2/autoload.php') ?: 'SebastianBergmann/Comparator/autoload.php');
}
if (!class_exists('SebastianBergmann\\RecursionContext\\Context')) { // v3 from phpunit, v2 from phpspec (via exporter)
require_once (stream_resolve_include_path('SebastianBergmann/RecursionContext3/autoload.php') ?: 'SebastianBergmann/RecursionContext/autoload.php');
}