File: 0001-Use-homemade-autoload.php.patch

package info (click to toggle)
php-nrk-predis 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 8,680 kB
  • sloc: php: 71,678; xml: 50; makefile: 12
file content (40 lines) | stat: -rw-r--r-- 1,276 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?= <david@tilapin.org>
Date: Wed, 10 May 2023 07:57:09 +0200
Subject: Use homemade autoload.php

Forwarded: not-needed
---
 examples/shared.php | 2 +-
 tests/bootstrap.php | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/examples/shared.php b/examples/shared.php
index f82e6b0..9bcaa19 100644
--- a/examples/shared.php
+++ b/examples/shared.php
@@ -14,7 +14,7 @@ if (PHP_SAPI !== 'cli') {
     exit('Example scripts are meant to be executed locally via CLI.');
 }
 
-require __DIR__ . '/../autoload.php';
+require 'Predis/autoload.php';
 
 function redis_version($info)
 {
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index c1dff70..696e1d1 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -10,7 +10,11 @@
  * file that was distributed with this source code.
  */
 
-if (file_exists(__DIR__ . '/../autoload.php')) {
+if (file_exists('Predis/autoload.php')) {
+    require 'Predis/autoload.php';
+} elseif (file_exists('/usr/share/php/Predis/autoload.php')) {
+    require '/usr/share/php/Predis/autoload.php';
+} elseif (file_exists(__DIR__ . '/../autoload.php')) {
     require __DIR__ . '/../autoload.php';
 } elseif (@include ('Predis/Autoloader.php')) {
     Predis\Autoloader::register();