summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Autoload.php.in21
-rw-r--r--php-phpunit-PHPUnit.spec5
2 files changed, 16 insertions, 10 deletions
diff --git a/Autoload.php.in b/Autoload.php.in
index 09be638..141aa8c 100644
--- a/Autoload.php.in
+++ b/Autoload.php.in
@@ -1,5 +1,5 @@
<?php
-/* Inspipred from Autoload from version 3.7 */
+/* Autoloader for phpunit/phpunit and its dependencies */
/* Required */
require_once 'File/Iterator/Autoload.php';
@@ -18,15 +18,18 @@ require_once 'Doctrine/Instantiator/autoload.php';
require_once 'Prophecy/autoload.php';
$vendorDir = '/usr/share/php';
-if (!(isset($sfuloader) && $sfuloader instanceof Symfony\Component\ClassLoader\UniversalClassLoader)) {
- require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
- $sfuloader = new Symfony\Component\ClassLoader\UniversalClassLoader();
- $sfuloader->register();
+// 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->registerNamespaces(array(
- 'Symfony\\Component\\Yaml' => $vendorDir,
- 'Symfony\\Component\\ClassLoader' => $vendorDir,
-));
+
+/* for symfony/yaml */
+$fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendorDir);
spl_autoload_register(
function ($class)
diff --git a/php-phpunit-PHPUnit.spec b/php-phpunit-PHPUnit.spec
index 4a10959..fdb4cbc 100644
--- a/php-phpunit-PHPUnit.spec
+++ b/php-phpunit-PHPUnit.spec
@@ -18,7 +18,7 @@
Name: php-phpunit-PHPUnit
Version: 4.7.5
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: The PHP Unit Testing framework
Group: Development/Libraries
@@ -204,6 +204,9 @@ fi
%changelog
+* Tue Jun 30 2015 Remi Collet <remi@fedoraproject.org> - 4.7.5-2
+- use $fedoraClassLoader autoloader
+
* Sun Jun 21 2015 Remi Collet <remi@fedoraproject.org> - 4.7.5-1
- Update to 4.7.5