mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-25 21:13:04 +07:00
Add support for expect and ssh2 using shivammathur/extensions on macOS
Add config to brew extensions and refactor add_brew_extension in darwin.sh to use it
This commit is contained in:
parent
5588437714
commit
ab12e42197
@ -73,12 +73,13 @@ describe('Extension tests', () => {
|
||||
|
||||
it('checking addExtensionOnDarwin', async () => {
|
||||
let darwin: string = await extensions.addExtension(
|
||||
'Xdebug, pcov, grpc, igbinary, imagick, phalcon3, phalcon4, protobuf, psr, rdkafka, swoole, vips, sqlite, ast-beta',
|
||||
'Xdebug, pcov, expect, grpc, igbinary, imagick, phalcon3, phalcon4, protobuf, psr, rdkafka, ssh2, swoole, vips, sqlite, ast-beta',
|
||||
'7.2',
|
||||
'darwin'
|
||||
);
|
||||
expect(darwin).toContain('add_brew_extension xdebug');
|
||||
expect(darwin).toContain('add_brew_extension pcov');
|
||||
expect(darwin).toContain('add_brew_extension expect');
|
||||
expect(darwin).toContain('add_brew_extension grpc');
|
||||
expect(darwin).toContain('add_brew_extension igbinary');
|
||||
expect(darwin).toContain('add_brew_extension imagick');
|
||||
@ -87,6 +88,7 @@ describe('Extension tests', () => {
|
||||
expect(darwin).toContain('add_brew_extension protobuf');
|
||||
expect(darwin).toContain('add_brew_extension psr');
|
||||
expect(darwin).toContain('add_brew_extension rdkafka');
|
||||
expect(darwin).toContain('add_brew_extension ssh2');
|
||||
expect(darwin).toContain('add_brew_extension swoole');
|
||||
expect(darwin).toContain('add_brew_extension vips');
|
||||
expect(darwin).toContain('pecl_install sqlite3');
|
||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -230,7 +230,7 @@ async function addExtensionDarwin(extension_csv, version) {
|
||||
' ' +
|
||||
ext_prefix;
|
||||
return;
|
||||
case /(5\.6|7\.[0-4]|8.0)(amqp|grpc|igbinary|imagick|imap|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|swoole|xdebug|xdebug2|yaml|zmq)/.test(version_extension):
|
||||
case /(5\.6|7\.[0-4]|8.0)(amqp|expect|grpc|igbinary|imagick|imap|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(version_extension):
|
||||
case /(7\.[1-4]|8\.0])pcov/.test(version_extension):
|
||||
case /^(5\.6|7\.[0-3])phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||
case /(7\.[0-4]|8\.0])vips/.test(version_extension):
|
||||
|
28
src/configs/brew_extensions
Normal file
28
src/configs/brew_extensions
Normal file
@ -0,0 +1,28 @@
|
||||
amqp=amqp
|
||||
apcu=apcu
|
||||
expect=expect
|
||||
grpc=grpc
|
||||
igbinary=igbinary
|
||||
imagick=imagick
|
||||
imap=imap
|
||||
memcache=memcache
|
||||
memcached=memcached
|
||||
mongodb=mongodb
|
||||
msgpack=msgpack
|
||||
pcov=pcov
|
||||
pecl_http=http
|
||||
phalcon3=phalcon
|
||||
phalcon4=phalcon
|
||||
propro=propro
|
||||
protobuf=protobuf
|
||||
psr=psr
|
||||
raphf=raphf
|
||||
rdkafka=rdkafka
|
||||
redis=redis
|
||||
ssh2=ssh2
|
||||
swoole=swoole
|
||||
vips=vips
|
||||
xdebug=xdebug
|
||||
xdebug2=xdebug
|
||||
yaml=yaml
|
||||
zmq=zmq
|
@ -30,10 +30,10 @@ export async function addExtensionDarwin(
|
||||
' ' +
|
||||
ext_prefix;
|
||||
return;
|
||||
// match 5.6 to 8.0 amqp, grpc, igbinary, imagick, imap, mongodb, msgpack, pecl_http, propro, protobuf, raphf, rdkafka, redis, swoole, xdebug, xdebug2, yaml, zmq
|
||||
// match 5.6 to 8.0 amqp, expect, grpc, igbinary, imagick, imap, mongodb, msgpack, pecl_http, propro, protobuf, raphf, rdkafka, redis, ssh2, swoole, xdebug, xdebug2, yaml, zmq
|
||||
// match 7.1pcov to 8.0pcov
|
||||
// match 7.0vips to 8.0vips
|
||||
case /(5\.6|7\.[0-4]|8.0)(amqp|grpc|igbinary|imagick|imap|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|swoole|xdebug|xdebug2|yaml|zmq)/.test(
|
||||
case /(5\.6|7\.[0-4]|8.0)(amqp|expect|grpc|igbinary|imagick|imap|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(
|
||||
version_extension
|
||||
):
|
||||
case /(7\.[1-4]|8\.0])pcov/.test(version_extension):
|
||||
|
@ -103,7 +103,8 @@ add_brew_tap() {
|
||||
# Function to install a php extension from shivammathur/extensions tap.
|
||||
add_brew_extension() {
|
||||
formula=$1
|
||||
extension=${formula//[0-9]/}
|
||||
extension=$(grep "$formula=" "$dist"/../src/configs/brew_extensions | cut -d '=' -f 2)
|
||||
[[ -z "$extension" ]] && extension="$(echo "$formula" | sed -E "s/pecl_|[0-9]//g")"
|
||||
add_brew_tap shivammathur/homebrew-php
|
||||
add_brew_tap shivammathur/homebrew-extensions
|
||||
sudo mv "$tap_dir"/shivammathur/homebrew-extensions/.github/deps/"$formula"/* "$tap_dir/homebrew/homebrew-core/Formula/" 2>/dev/null || true
|
||||
|
Loading…
Reference in New Issue
Block a user