summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-04-04 19:26:35 +0200
committerRemi Collet <fedora@famillecollet.com>2016-04-04 19:26:35 +0200
commit2bddaa4218f7b7ec530c526ef533c4612c112c3c (patch)
treec5aca6025cef5776a30a4e2c05c2e1f8c594e50e
parent1ada833f2d727d68b83c22878a37842c6de3998a (diff)
php-hoa-event: use Hoa autoloader
-rw-r--r--php-hoa-event-autoload.php15
-rw-r--r--php-hoa-event.spec3
2 files changed, 4 insertions, 14 deletions
diff --git a/php-hoa-event-autoload.php b/php-hoa-event-autoload.php
index 02ad1f9..02c39d6 100644
--- a/php-hoa-event-autoload.php
+++ b/php-hoa-event-autoload.php
@@ -2,23 +2,14 @@
/* Autoloader for hoa/event and its dependencies */
$vendor = '/usr/share/php';
-// Use Symfony autoloader
-if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
- require_once $vendor . '/Symfony/Component/ClassLoader/ClassLoader.php';
- }
-
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-$fedoraClassLoader->addPrefix('Hoa\\Event\\', dirname(dirname(__DIR__)));
// Dependencies
foreach ([
$vendor . '/Hoa/Consistency/autoload.php' => true,
$vendor . '/Hoa/Exception/autoload.php' => true,
] as $dep => $mandatory) {
- if ($mandory || file_exists($dep) require_once($dep);
+ if ($mandatory || file_exists($dep)) require_once($dep);
}
+$fedoraHoaLoader->addNamespace('Hoa\\Event\\', __DIR__, true);
+
diff --git a/php-hoa-event.spec b/php-hoa-event.spec
index 52a4b18..72a422e 100644
--- a/php-hoa-event.spec
+++ b/php-hoa-event.spec
@@ -98,8 +98,7 @@ rm -rf %{buildroot}
%license LICENSE
%doc composer.json
%doc *md
-%dir %{php_home}/%{ns_vendor}
- %{php_home}/%{ns_vendor}/%{ns_project}
+%{php_home}/%{ns_vendor}/%{ns_project}
%changelog