summaryrefslogtreecommitdiffstats
path: root/php-sabre-dav-autoload.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-10-29 15:35:33 +0200
committerRemi Collet <fedora@famillecollet.com>2016-10-29 15:35:33 +0200
commit3c9a991ffe0fb29a29498cecf171cfc88d0da46b (patch)
treec32321b04223cae66061bb9ba2d2b15ce5a3c4e3 /php-sabre-dav-autoload.php
parent863da66d20b908169f5c65412339f0df5de76318 (diff)
php-sabre-dav: switch from symfony/class-loader to fedora/autoloader
Diffstat (limited to 'php-sabre-dav-autoload.php')
-rw-r--r--php-sabre-dav-autoload.php37
1 files changed, 12 insertions, 25 deletions
diff --git a/php-sabre-dav-autoload.php b/php-sabre-dav-autoload.php
index 93a3196..160dfab 100644
--- a/php-sabre-dav-autoload.php
+++ b/php-sabre-dav-autoload.php
@@ -1,31 +1,18 @@
<?php
-/**
- * Autoloader for sabre/dav and its dependencies
- */
+/* Autoloader for sabre/dav and its dependencies */
-$vendorDir = '/usr/share/php';
+require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
-// 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';
- }
+\Fedora\Autoloader\Autoload::addPsr4('Sabre\\DAV\\', dirname(__DIR__) . '/DAV');
+\Fedora\Autoloader\Autoload::addPsr4('Sabre\\DAVACL\\', dirname(__DIR__) . '/DAVACL');
+\Fedora\Autoloader\Autoload::addPsr4('Sabre\\CalDAV\\', dirname(__DIR__) . '/CalDAV');
+\Fedora\Autoloader\Autoload::addPsr4('Sabre\\CardDAV\\', dirname(__DIR__) . '/CardDAV');
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-$thisdir = dirname(dirname(__DIR__));
-$fedoraClassLoader->addPrefixes(array(
- 'Sabre\\DAV\\' => $thisdir,
- 'Sabre\\DAVACL\\' => $thisdir,
- 'Sabre\\CalDAV\\' => $thisdir,
- 'Sabre\\CardDAV\\' => $thisdir,
+\Fedora\Autoloader\Dependencies::required(array(
+ '/usr/share/php/Sabre/Event/autoload.php',
+ '/usr/share/php/Sabre/HTTP/autoload.php',
+ '/usr/share/php/Sabre/VObject/autoload.php',
+ '/usr/share/php/Sabre/Xml/autoload.php',
+ '/usr/share/php/Sabre/Uri/autoload.php',
));
-// dependencies
-require_once $vendorDir . '/Sabre/Event/autoload.php';
-require_once $vendorDir . '/Sabre/HTTP/autoload.php';
-require_once $vendorDir . '/Sabre/VObject/autoload.php';
-require_once $vendorDir . '/Sabre/Xml/autoload.php';
-require_once $vendorDir . '/Sabre/Uri/autoload.php';