gearman extension feature

This commit is contained in:
hotrush 2019-12-12 14:48:47 +03:00
parent cfa7bc51cd
commit a5e13fab3b
3 changed files with 26 additions and 0 deletions

View File

@ -52,6 +52,9 @@ describe('Extension tests', () => {
linux = await extensions.addExtension('phalcon4', '7.4', 'linux'); linux = await extensions.addExtension('phalcon4', '7.4', 'linux');
expect(linux).toContain('phalcon.sh 4.0.x 7.4'); expect(linux).toContain('phalcon.sh 4.0.x 7.4');
linux = await extensions.addExtension('gearman', '7.3', 'linux');
expect(linux).toContain('gearman.sh gearman2.0.6 7.3');
linux = await extensions.addExtension('xdebug', '7.2', 'fedora'); linux = await extensions.addExtension('xdebug', '7.2', 'fedora');
expect(linux).toContain('Platform fedora is not supported'); expect(linux).toContain('Platform fedora is not supported');
}); });

View File

@ -106,6 +106,18 @@ export async function addExtensionLinux(
version + version +
' >/dev/null 2>&1'; ' >/dev/null 2>&1';
break; break;
case '7.0gearman':
case '7.1gearman':
case '7.2gearman':
case '7.3gearman':
// case '7.4gearman': // no 7.4 support for now, hope for 2.0.7
install_command =
'sh ' +
path.join(__dirname, '../src/scripts/gearman.sh') +
' gearman-2.0.6' +
version +
' >/dev/null 2>&1'
break;
default: default:
install_command = install_command =
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php' + 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php' +

11
src/scripts/gearman.sh Normal file
View File

@ -0,0 +1,11 @@
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev
for tool in php-config phpize; do
if [ -e "/usr/bin/$tool$2" ]; then
sudo update-alternatives --set $tool /usr/bin/"$tool$2"
fi
done
cd ~ && git clone --depth=1 -v https://github.com/wcgallego/pecl-gearman.git -b "$1"
cd pecl-gearman && /usr/bin/phpize"$2" && ./configure && make && sudo make install
echo "extension=gearman.so" >> "$ini_file"