summaryrefslogtreecommitdiffstats
path: root/php-sabre-dav-autoload.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-03-16 13:14:15 +0100
committerRemi Collet <fedora@famillecollet.com>2016-03-16 13:14:15 +0100
commit93b59fe5fb7b4829a7d9887dde80b14265d89721 (patch)
tree23a3b1dd3bfc9db2c1a2e3b5b4800400a68be85e /php-sabre-dav-autoload.php
parent0a01943f5f730ecee40be200f9714f951c62bc9c (diff)
php-sabre-dav: 2.1.6 (synced with Fedora)
Diffstat (limited to 'php-sabre-dav-autoload.php')
-rw-r--r--php-sabre-dav-autoload.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/php-sabre-dav-autoload.php b/php-sabre-dav-autoload.php
new file mode 100644
index 0000000..938d523
--- /dev/null
+++ b/php-sabre-dav-autoload.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Autoloader for sabre/dav and its dependencies
+ */
+
+$vendorDir = '/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 $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php';
+ }
+
+ $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,
+));
+
+// dependencies
+require_once $vendorDir . '/Sabre/Event/autoload.php';
+require_once $vendorDir . '/Sabre/HTTP/autoload.php';
+require_once $vendorDir . '/Sabre/VObject/autoload.php';