From 70d858dd49d2ac145f147f50339e6332ee34e0e9 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 17 Feb 2021 16:29:24 +0530 Subject: [PATCH] Add support for msgpack and redis on macOS for PHP 5.6+ --- __tests__/extensions.test.ts | 10 +++------- dist/index.js | 8 ++------ src/extensions.ts | 8 ++------ 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts index b15efd0d..c69918ae 100644 --- a/__tests__/extensions.test.ts +++ b/__tests__/extensions.test.ts @@ -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' ); @@ -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'); @@ -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'); diff --git a/dist/index.js b/dist/index.js index e265c7cd..2b446b73 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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'; diff --git a/src/extensions.ts b/src/extensions.ts index e102f466..376fc333 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -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): @@ -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';