summaryrefslogtreecommitdiffstats
path: root/php-phpmd-PHP-PMD-autoload.php
diff options
context:
space:
mode:
Diffstat (limited to 'php-phpmd-PHP-PMD-autoload.php')
-rw-r--r--php-phpmd-PHP-PMD-autoload.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/php-phpmd-PHP-PMD-autoload.php b/php-phpmd-PHP-PMD-autoload.php
new file mode 100644
index 0000000..0d8d87e
--- /dev/null
+++ b/php-phpmd-PHP-PMD-autoload.php
@@ -0,0 +1,22 @@
+<?php
+/* Autoloader for pdepend/pdepend 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();
+}
+
+/* PHPMD */
+$fedoraClassLoader->addPrefix('PHPMD\\', dirname(__DIR__));
+
+/* for symfony/dependency-injection, filesystem and config */
+$fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendorDir);
+
+/* PDepend */
+require_once $vendorDir . '/PDepend/autoload.php';