File: 0001-Allow-require-to-search-in-the-path.patch

package info (click to toggle)
php-parser 3.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,940 kB
  • sloc: php: 14,410; yacc: 1,791; makefile: 23; sh: 4
file content (40 lines) | stat: -rw-r--r-- 1,023 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Wed, 3 Sep 2014 23:28:35 -0400
Subject: Allow require to search in the path

Forwarded: not-needed
---
 bin/php-parse     | 7 +------
 lib/bootstrap.php | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/bin/php-parse b/bin/php-parse
index 1760e75..f7b9242 100755
--- a/bin/php-parse
+++ b/bin/php-parse
@@ -1,12 +1,7 @@
 #!/usr/bin/env php
 <?php
 
-foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) {
-    if (file_exists($file)) {
-        require $file;
-        break;
-    }
-}
+require 'PhpParser/autoload.php';
 
 ini_set('xdebug.max_nesting_level', 3000);
 
diff --git a/lib/bootstrap.php b/lib/bootstrap.php
index b0f5178..e54eb9b 100644
--- a/lib/bootstrap.php
+++ b/lib/bootstrap.php
@@ -1,6 +1,6 @@
 <?php
 
 if (!class_exists('PhpParser\Autoloader')) {
-    require __DIR__ . '/PhpParser/Autoloader.php';
+    require 'PhpParser/Autoloader.php';
 }
 PhpParser\Autoloader::register();