Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add php-8.4-memcached.yaml and php-8.4-redis.yaml. #34897

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading