Subject: [bug#67902] [PATCH 31/95] gnu: Add php-predis-predis.

From: Nicolas Graves <[email-masked]>
Date: Tue, 19 Dec 2023 14:57:12 +0100

* gnu/packages/php-xyz.scm (php-predis-predis): New variable.

Change-Id: I34fa3edc7978bc5108ef8d71fb0d75ebeb290ffa
---
 gnu/packages/php-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm
index b6fb3e0ac2..09b2d9797e 100644
--- a/gnu/packages/php-xyz.scm
+++ b/gnu/packages/php-xyz.scm
@@ -830,3 +830,37 @@ (define-public php-phpunit-php-token-stream
 extension.")
     (license license:bsd-3)))
 
+(define-public php-predis-predis
+  (package
+    (name "php-predis-predis")
+    (version "2.2.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/predis/predis")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1y0cn6mmqkdh56jlhqx8fjmkr8nipw20rnwgpc9y9qgk0l0mv4c8"))))
+    (build-system composer-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'pre-check
+            (lambda _
+              ;; Launch the redis server.
+              (invoke "redis-server" "--daemonize" "yes")
+              ;; Fix the sole failing test.
+              (substitute* "tests/Predis/Command/Redis/ACL_Test.php"
+                (("User Test has no permissions to run the 'get' command")
+                 "This user has no permissions to run the 'get' command")))))))
+    (native-inputs
+     (list redis php-phpunit-phpunit))
+    (synopsis "Redis client for PHP")
+    (description "This package provides a flexible and feature-complete Redis
+client for PHP.")
+    (home-page "https://github.com/predis/predis")
+    (license license:expat)))
+
-- 
2.41.0