summaryrefslogtreecommitdiffstats
path: root/php-kdyby-events-autoload.php
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-05-09 10:17:00 +0200
committerRemi Collet <remi@remirepo.net>2017-05-09 10:17:00 +0200
commit8faf1563537a66c19ac05840e7baa1c65601a4fc (patch)
tree3a4646cc64d16e158b034060d989e9bf9c7f6e2e /php-kdyby-events-autoload.php
parentec4ad37e40ea1b2ac4308977eaaa79f1eadf6e32 (diff)
switch to fedora-autoloader
Diffstat (limited to 'php-kdyby-events-autoload.php')
-rw-r--r--php-kdyby-events-autoload.php25
1 files changed, 9 insertions, 16 deletions
diff --git a/php-kdyby-events-autoload.php b/php-kdyby-events-autoload.php
index 7f9fc3a..a83a6de 100644
--- a/php-kdyby-events-autoload.php
+++ b/php-kdyby-events-autoload.php
@@ -1,18 +1,11 @@
<?php
-$vendor = '/usr/share/php';
+/* Autoloader for kdyby/events and its dependencies */
+require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
-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('Kdyby\\Events\\', dirname(dirname(__DIR__)));
-require_once __DIR__ . '/exceptions.php';
-
-// Dependencies
-require_once $vendor . '/Doctrine/Common/autoload.php';
-require_once $vendor . '/Nette/DI/autoload.php';
-require_once $vendor . '/Nette/Utils/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('Kdyby\\Events\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required(array(
+ __DIR__ . '/exceptions.php',
+ '/usr/share/php/Doctrine/Common/autoload.php',
+ '/usr/share/php/Nette/DI/autoload.php',
+ '/usr/share/php/Nette/Utils/autoload.php',
+));