Skip to content

Commit

Permalink
Add support for msgpack and redis on macOS for PHP 5.6+
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Feb 19, 2021
1 parent 3340d60 commit 70d858d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
10 changes: 3 additions & 7 deletions __tests__/extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('Extension tests', () => {

it('checking addExtensionOnDarwin', async () => {
let darwin: string = await extensions.addExtension(
'amqp, Xdebug, pcov, grpc, igbinary, imagick, imap, protobuf, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
'amqp, Xdebug, pcov, grpc, igbinary, imagick, imap, msgpack, protobuf, redis, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
'7.2',
'darwin'
);
Expand All @@ -171,7 +171,9 @@ describe('Extension tests', () => {
expect(darwin).toContain('add_brew_extension igbinary extension');
expect(darwin).toContain('add_brew_extension imagick extension');
expect(darwin).toContain('add_brew_extension imap extension');
expect(darwin).toContain('add_brew_extension msgpack extension');
expect(darwin).toContain('add_brew_extension protobuf extension');
expect(darwin).toContain('add_brew_extension redis extension');
expect(darwin).toContain('add_brew_extension swoole extension');
expect(darwin).toContain('add_extension sqlite3');
expect(darwin).toContain('remove_extension intl');
Expand Down Expand Up @@ -226,12 +228,6 @@ describe('Extension tests', () => {
darwin = await extensions.addExtension('xdebug2', '7.2', 'darwin');
expect(darwin).toContain('add_brew_extension xdebug2');

darwin = await extensions.addExtension('redis', '5.6', 'darwin');
expect(darwin).toContain('add_extension redis-2.2.8');

darwin = await extensions.addExtension('redis', '7.2', 'darwin');
expect(darwin).toContain('add_extension redis');

darwin = await extensions.addExtension('imagick', '5.5', 'darwin');
expect(darwin).toContain('add_extension imagick');

Expand Down
8 changes: 2 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2938,18 +2938,14 @@ async function addExtensionDarwin(extension_csv, version) {
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
return;
// match 5.6 to 8.9 for amqp, grpc, igbinary, imagick, imap, protobuf, raphf, swoole, xdebug, xdebug2, zmq
// match 5.6 to 8.9 for amqp, grpc, igbinary, imagick, imap, msgpack, protobuf, raphf, redis, swoole, xdebug, xdebug2, zmq
// match 7.1 to 8.9 for pcov
// match 5.6 to 7.4 for propro
case /(5\.6|7\.[0-4]|8\.[0-9])(amqp|grpc|igbinary|imagick|imap|protobuf|raphf|swoole|xdebug|xdebug2|zmq)/.test(version_extension):
case /(5\.6|7\.[0-4]|8\.[0-9])(amqp|grpc|igbinary|imagick|imap|msgpack|protobuf|raphf|redis|swoole|xdebug|xdebug2|zmq)/.test(version_extension):
case /(5\.6|7\.[0-4])propro/.test(version_extension):
case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension):
add_script += await utils.joins('\nadd_brew_extension', ext_name, ext_prefix);
return;
// match 5.6redis
case /^5\.6redis$/.test(version_extension):
extension = 'redis-2.2.8';
break;
// match sqlite
case /^sqlite$/.test(extension):
extension = 'sqlite3';
Expand Down
8 changes: 2 additions & 6 deletions src/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ export async function addExtensionDarwin(
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
return;
// match 5.6 to 8.9 for amqp, grpc, igbinary, imagick, imap, protobuf, raphf, swoole, xdebug, xdebug2, zmq
// match 5.6 to 8.9 for amqp, grpc, igbinary, imagick, imap, msgpack, protobuf, raphf, redis, swoole, xdebug, xdebug2, zmq
// match 7.1 to 8.9 for pcov
// match 5.6 to 7.4 for propro
case /(5\.6|7\.[0-4]|8\.[0-9])(amqp|grpc|igbinary|imagick|imap|protobuf|raphf|swoole|xdebug|xdebug2|zmq)/.test(
case /(5\.6|7\.[0-4]|8\.[0-9])(amqp|grpc|igbinary|imagick|imap|msgpack|protobuf|raphf|redis|swoole|xdebug|xdebug2|zmq)/.test(
version_extension
):
case /(5\.6|7\.[0-4])propro/.test(version_extension):
Expand All @@ -93,10 +93,6 @@ export async function addExtensionDarwin(
ext_prefix
);
return;
// match 5.6redis
case /^5\.6redis$/.test(version_extension):
extension = 'redis-2.2.8';
break;
// match sqlite
case /^sqlite$/.test(extension):
extension = 'sqlite3';
Expand Down

0 comments on commit 70d858d

Please sign in to comment.