Skip to content

Commit

Permalink
Add php-8.4-memcached.yaml and php-8.4-redis.yaml. (#34897)
Browse files Browse the repository at this point in the history
These were split from #34683 due to
failing to pass c-i. that seemed to be due to the fact that these two
packages depend on php-8.4-igbinary.

They're just copy and 'sed'it from the php-8.3-<module> name.
  • Loading branch information
smoser authored Nov 21, 2024
1 parent c82d10c commit 5e141d2
Show file tree
Hide file tree
Showing 2 changed files with 175 additions and 0 deletions.
67 changes: 67 additions & 0 deletions php-8.4-memcached.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package:
name: php-8.4-memcached
version: 3.3.0
epoch: 0
description: "A PHP extension for Memcached"
copyright:
- license: PHP-3.01
dependencies:
runtime:
- ${{package.name}}-config
- php-${{vars.phpMM}}

var-transforms:
- from: ${{package.name}}
match: ^php-(\d+\.\d+)-.*$
replace: "$1"
to: phpMM

environment:
contents:
packages:
- autoconf
- build-base
- busybox
- libmemcached-dev
- php-${{vars.phpMM}}
- php-${{vars.phpMM}}-dev
- php-${{vars.phpMM}}-igbinary-dev
- zlib-dev

pipeline:
- uses: git-checkout
with:
repository: https://github.com/php-memcached-dev/php-memcached
tag: v${{package.version}}
expected-commit: b0b82692d789a2a5fd95b3910e87f73615c0f918

- name: Prepare build
runs: phpize

- name: Configure
runs: ./configure

- uses: autoconf/make

- name: Make install
runs: |
INSTALL_ROOT="${{targets.destdir}}" DESTDIR="${{targets.destdir}}" make install
subpackages:
- name: ${{package.name}}-config
pipeline:
- runs: |
mkdir -p "${{targets.subpkgdir}}/etc/php/conf.d"
echo "extension=memcached.so" > "${{targets.subpkgdir}}/etc/php/conf.d/memcached.ini"
- name: ${{package.name}}-dev
description: PHP ${{vars.phpMM}} memcached development headers
pipeline:
- uses: split/dev

update:
enabled: true
github:
identifier: php-memcached-dev/php-memcached
strip-prefix: v
tag-filter: v
108 changes: 108 additions & 0 deletions php-8.4-redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package:
name: php-8.4-redis
version: 6.1.0
epoch: 0
description: "A PHP extension for Redis"
copyright:
- license: PHP-3.01
dependencies:
runtime:
- ${{package.name}}-config
- php-${{vars.phpMM}}
- php-${{vars.phpMM}}-igbinary

var-transforms:
- from: ${{package.name}}
match: ^php-(\d+\.\d+)-.*$
replace: "$1"
to: phpMM

environment:
contents:
packages:
- autoconf
- build-base
- busybox
- php-${{vars.phpMM}}
- php-${{vars.phpMM}}-dev
- php-${{vars.phpMM}}-igbinary-dev

pipeline:
- uses: git-checkout
with:
repository: https://github.com/phpredis/phpredis
tag: ${{package.version}}
expected-commit: 5419cc9c60d1ee04163b4d5323dd0fb02fb4f8bb

- name: Prepare build
runs: phpize

- name: Configure
runs: ./configure --enable-redis-igbinary

- uses: autoconf/make

- name: Make install
runs: |
INSTALL_ROOT="${{targets.destdir}}" DESTDIR="${{targets.destdir}}" make install
subpackages:
- name: ${{package.name}}-config
pipeline:
- runs: |
mkdir -p "${{targets.subpkgdir}}/etc/php/conf.d"
echo "extension=redis.so" > "${{targets.subpkgdir}}/etc/php/conf.d/redis.ini"
- name: ${{package.name}}-dev
description: PHP ${{vars.phpMM}} redis development headers
pipeline:
- uses: split/dev

update:
enabled: true
github:
identifier: phpredis/phpredis

test:
environment:
contents:
packages:
- php-${{vars.phpMM}}
pipeline:
- name: Verify Extension is Loaded
runs: |
# Ensure the extension configuration is in place
if [ ! -f /etc/php/conf.d/redis.ini ]; then
echo "extension=redis.so" > /etc/php/conf.d/redis.ini
fi
# List loaded PHP modules and check for 'redis'
php -m | grep -i 'redis'
if [ $? -ne 0 ]; then
echo "Test failed: Redis extension is not loaded."
exit 1
else
echo "Test passed: Redis extension is loaded."
fi
- name: Test Basic Redis Functionality
runs: |
# Create a PHP script to test the extension
echo "<?php
\$redis = new Redis();
if (!\$redis) {
echo 'Failed to create Redis instance';
exit(1);
}
echo 'Redis extension is functional';
?>" > test.php
# Run the PHP script
php test.php
# Check the output
if [ $? -ne 0 ]; then
echo "Test failed: Unable to use Redis extension."
exit 1
else
echo "Test passed: Redis extension is functional."
fi

0 comments on commit 5e141d2

Please sign in to comment.