diff options
-rw-r--r-- | autoload.php.in | 24 | ||||
-rw-r--r-- | php-phpunit-FinderFacade.spec | 5 |
2 files changed, 16 insertions, 13 deletions
diff --git a/autoload.php.in b/autoload.php.in index 5309eae..a5f9520 100644 --- a/autoload.php.in +++ b/autoload.php.in @@ -1,20 +1,21 @@ <?php -/* Inspipred from Autoload from version 1.1 */ +/* Autoloader for sebastian/finder-facade and its dependencies */ $vendorDir = '/usr/share/php'; require_once $vendorDir . '/TheSeer/fDOMDocument/autoload.php'; -require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php'; -use Symfony\Component\ClassLoader\UniversalClassLoader; +// Use Symfony autoloader +if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { + if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { + require_once $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php'; + } + + $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); + $fedoraClassLoader->register(); +} -$sfuloader = new UniversalClassLoader(); -$sfuloader->registerNamespaces(array( - 'Symfony\\Component\\Finder' => $vendorDir, - 'Symfony\\Component\\ClassLoader' => $vendorDir, -)); -$sfuloader->register(); +/* For symfony/finder */ +$fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendorDir); -// @codingStandardsIgnoreFile -// @codeCoverageIgnoreStart spl_autoload_register( function($class) { static $classes = NULL; @@ -32,4 +33,3 @@ spl_autoload_register( } } ); -// @codeCoverageIgnoreEnd diff --git a/php-phpunit-FinderFacade.spec b/php-phpunit-FinderFacade.spec index 4a62cb8..96c6857 100644 --- a/php-phpunit-FinderFacade.spec +++ b/php-phpunit-FinderFacade.spec @@ -17,7 +17,7 @@ Name: php-phpunit-FinderFacade Version: 1.2.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Wrapper for Symfony Finder component Group: Development/Libraries @@ -107,6 +107,9 @@ fi %changelog +* Mon Jun 29 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-3 +- switch to $fedoraClassLoader autoloader + * Thu Jun 4 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-2 - use $sfuloader |