summaryrefslogtreecommitdiffstats
path: root/php-phpmd-PHP-PMD-rpm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'php-phpmd-PHP-PMD-rpm.patch')
-rw-r--r--php-phpmd-PHP-PMD-rpm.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/php-phpmd-PHP-PMD-rpm.patch b/php-phpmd-PHP-PMD-rpm.patch
new file mode 100644
index 0000000..98be5bc
--- /dev/null
+++ b/php-phpmd-PHP-PMD-rpm.patch
@@ -0,0 +1,45 @@
+diff -up src/bin/phpmd.rpm src/bin/phpmd
+--- src/bin/phpmd.rpm 2015-07-02 10:03:08.578182650 +0200
++++ src/bin/phpmd 2015-07-02 10:04:10.727496791 +0200
+@@ -3,23 +3,7 @@
+
+ use PHPMD\TextUI\Command;
+
+-if (file_exists(__DIR__ . '/../../../../autoload.php')) {
+- // phpmd is part of a composer installation
+- require_once __DIR__ . '/../../../../autoload.php';
+-} else {
+- require_once __DIR__ . '/../../vendor/autoload.php';
+-
+- // PEAR installation workaround
+- if (strpos('@package_version@', '@package_version') === 0) {
+- set_include_path(
+- dirname(__FILE__) . '/../main/php' .
+- PATH_SEPARATOR .
+- dirname(__FILE__) . '/../../vendor/pdepend/pdepend/src/main/php' .
+- PATH_SEPARATOR .
+- '.'
+- );
+- }
+-}
++require '/usr/share/php/PHPMD/autoload.php';
+
+ if (!ini_get('date.timezone') && !date_default_timezone_get()) {
+ date_default_timezone_set('UTC');
+diff -up src/main/php/PHPMD/RuleSetFactory.php.rpm src/main/php/PHPMD/RuleSetFactory.php
+--- src/main/php/PHPMD/RuleSetFactory.php.rpm 2015-07-02 10:05:14.076816993 +0200
++++ src/main/php/PHPMD/RuleSetFactory.php 2015-07-02 10:06:06.854083755 +0200
+@@ -79,12 +79,7 @@ class RuleSetFactory
+ */
+ public function __construct()
+ {
+- // PEAR installer workaround
+- if (strpos($this->location, '@data_dir') === 0) {
+- $this->location = __DIR__ . '/../../resources';
+- } else {
+- $this->location .= '/PHPMD/resources';
+- }
++ $this->location = __DIR__ . '/../../php-phpmd-PHP-PMD/resources';
+ }
+
+ /**