summaryrefslogtreecommitdiffstats
path: root/php-sabre-dav-autoload-dev.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-05-31 14:34:08 +0200
committerRemi Collet <fedora@famillecollet.com>2016-05-31 14:34:08 +0200
commitde30425bd5e8f3ce50d3b8a5a319aabb76dff226 (patch)
treeb8c9269b6bcf9c18db9b87fe84491b7a8356f067 /php-sabre-dav-autoload-dev.php
parent7a10451fb743af722591c3fefe967a88dac5d31c (diff)
php-sabre-dav: dup the spec
Diffstat (limited to 'php-sabre-dav-autoload-dev.php')
-rw-r--r--php-sabre-dav-autoload-dev.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/php-sabre-dav-autoload-dev.php b/php-sabre-dav-autoload-dev.php
new file mode 100644
index 0000000..938d523
--- /dev/null
+++ b/php-sabre-dav-autoload-dev.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';