mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Add support for ext-gearman. Closes #116
This commit is contained in:
parent
87e6c70743
commit
8f8207a1ca
@ -41,16 +41,32 @@ describe('Extension tests', () => {
|
||||
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-igbinary php7.4-redis'
|
||||
);
|
||||
|
||||
linux = await extensions.addExtension('phalcon3, phalcon4', '7.2', 'linux');
|
||||
linux = await extensions.addExtension('gearman', '7.0', 'linux');
|
||||
expect(linux).toContain('gearman.sh 7.0');
|
||||
linux = await extensions.addExtension('gearman', '7.1', 'linux');
|
||||
expect(linux).toContain('gearman.sh 7.1');
|
||||
|
||||
linux = await extensions.addExtension(
|
||||
'phalcon3, phalcon4, gearman',
|
||||
'7.2',
|
||||
'linux'
|
||||
);
|
||||
expect(linux).toContain('phalcon.sh master 7.2');
|
||||
expect(linux).toContain('phalcon.sh 4.0.x 7.2');
|
||||
expect(linux).toContain('gearman.sh 7.2');
|
||||
|
||||
linux = await extensions.addExtension('phalcon3, phalcon4', '7.3', 'linux');
|
||||
linux = await extensions.addExtension(
|
||||
'phalcon3, phalcon4, gearman',
|
||||
'7.3',
|
||||
'linux'
|
||||
);
|
||||
expect(linux).toContain('phalcon.sh master 7.3');
|
||||
expect(linux).toContain('phalcon.sh 4.0.x 7.3');
|
||||
expect(linux).toContain('gearman.sh 7.3');
|
||||
|
||||
linux = await extensions.addExtension('phalcon4', '7.4', 'linux');
|
||||
linux = await extensions.addExtension('phalcon4, gearman', '7.4', 'linux');
|
||||
expect(linux).toContain('phalcon.sh 4.0.x 7.4');
|
||||
expect(linux).toContain('gearman.sh 7.4');
|
||||
|
||||
linux = await extensions.addExtension('xdebug', '7.2', 'fedora');
|
||||
expect(linux).toContain('Platform fedora is not supported');
|
||||
|
12
dist/index.js
vendored
12
dist/index.js
vendored
@ -2208,6 +2208,18 @@ function addExtensionLinux(extension_csv, version) {
|
||||
version +
|
||||
' >/dev/null 2>&1';
|
||||
break;
|
||||
case '7.0gearman':
|
||||
case '7.1gearman':
|
||||
case '7.2gearman':
|
||||
case '7.3gearman':
|
||||
case '7.4gearman':
|
||||
install_command =
|
||||
'sh ' +
|
||||
path.join(__dirname, '../src/scripts/gearman.sh') +
|
||||
' ' +
|
||||
version +
|
||||
' >/dev/null 2>&1';
|
||||
break;
|
||||
default:
|
||||
install_command =
|
||||
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php' +
|
||||
|
@ -106,6 +106,18 @@ export async function addExtensionLinux(
|
||||
version +
|
||||
' >/dev/null 2>&1';
|
||||
break;
|
||||
case '7.0gearman':
|
||||
case '7.1gearman':
|
||||
case '7.2gearman':
|
||||
case '7.3gearman':
|
||||
case '7.4gearman':
|
||||
install_command =
|
||||
'sh ' +
|
||||
path.join(__dirname, '../src/scripts/gearman.sh') +
|
||||
' ' +
|
||||
version +
|
||||
' >/dev/null 2>&1';
|
||||
break;
|
||||
default:
|
||||
install_command =
|
||||
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php' +
|
||||
|
9
src/scripts/gearman.sh
Normal file
9
src/scripts/gearman.sh
Normal file
@ -0,0 +1,9 @@
|
||||
release_version=$(lsb_release -s -r)
|
||||
sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/pkg-gearman -y
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
|
||||
|
||||
if [ "$release_version" = "18.04" ]; then
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y libgearman-dev php"$1"-gearman
|
||||
elif [ "$release_version" = "16.04" ]; then
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$1"-gearman
|
||||
fi
|
Loading…
Reference in New Issue
Block a user