Merge pull request #127 from shivammathur/develop

Hotfix to support phalcon after v4 release
This commit is contained in:
Shivam Mathur 2019-12-22 10:02:11 +05:30 committed by GitHub
commit a507be73b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 15 deletions

View File

@ -51,8 +51,8 @@ describe('Extension tests', () => {
'7.2', '7.2',
'linux' 'linux'
); );
expect(linux).toContain('phalcon.sh 3.4.x 7.2');
expect(linux).toContain('phalcon.sh master 7.2'); 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'); expect(linux).toContain('gearman.sh 7.2');
linux = await extensions.addExtension( linux = await extensions.addExtension(
@ -60,12 +60,12 @@ describe('Extension tests', () => {
'7.3', '7.3',
'linux' 'linux'
); );
expect(linux).toContain('phalcon.sh 3.4.x 7.3');
expect(linux).toContain('phalcon.sh master 7.3'); 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'); expect(linux).toContain('gearman.sh 7.3');
linux = await extensions.addExtension('phalcon4, gearman', '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('phalcon.sh master 7.4');
expect(linux).toContain('gearman.sh 7.4'); expect(linux).toContain('gearman.sh 7.4');
linux = await extensions.addExtension('xdebug', '7.2', 'fedora'); linux = await extensions.addExtension('xdebug', '7.2', 'fedora');

4
dist/index.js vendored
View File

@ -2270,7 +2270,7 @@ function addExtensionLinux(extension_csv, version) {
install_command = install_command =
'sh ' + 'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') + path.join(__dirname, '../src/scripts/phalcon.sh') +
' master ' + ' 3.4.x ' +
version + version +
' >/dev/null 2>&1'; ' >/dev/null 2>&1';
break; break;
@ -2280,7 +2280,7 @@ function addExtensionLinux(extension_csv, version) {
install_command = install_command =
'sh ' + 'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') + path.join(__dirname, '../src/scripts/phalcon.sh') +
' 4.0.x ' + ' master ' +
version + version +
' >/dev/null 2>&1'; ' >/dev/null 2>&1';
break; break;

View File

@ -92,7 +92,7 @@ export async function addExtensionLinux(
install_command = install_command =
'sh ' + 'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') + path.join(__dirname, '../src/scripts/phalcon.sh') +
' master ' + ' 3.4.x ' +
version + version +
' >/dev/null 2>&1'; ' >/dev/null 2>&1';
break; break;
@ -102,7 +102,7 @@ export async function addExtensionLinux(
install_command = install_command =
'sh ' + 'sh ' +
path.join(__dirname, '../src/scripts/phalcon.sh') + path.join(__dirname, '../src/scripts/phalcon.sh') +
' 4.0.x ' + ' master ' +
version + version +
' >/dev/null 2>&1'; ' >/dev/null 2>&1';
break; break;

View File

@ -1,8 +1,10 @@
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
ini_dir=$(php --ini | grep in: | sed -e "s|.*:s*||" | sed "s/ //g")
if [ ! "$(apt-cache search php"$2"-psr)" ]; then if [ ! "$(apt-cache search php"$2"-psr)" ]; then
sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y >/dev/null 2>&1 sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y >/dev/null 2>&1
fi fi
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev php"$2"-psr sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-psr
for tool in php-config phpize; do for tool in php-config phpize; do
if [ -e "/usr/bin/$tool$2" ]; then if [ -e "/usr/bin/$tool$2" ]; then
sudo update-alternatives --set $tool /usr/bin/"$tool$2" sudo update-alternatives --set $tool /usr/bin/"$tool$2"
@ -17,10 +19,6 @@ if [ ! "$(apt-cache search php"$2"-psr)" ]; then
echo "extension=psr.so" >> "$ini_file" echo "extension=psr.so" >> "$ini_file"
fi fi
if [ "$1" = "master" ]; then cd ~ && git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1"
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-phalcon cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2"
else echo "extension=phalcon.so" | sudo tee "$ini_dir/50-phalcon.ini"
cd ~ && git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1"
cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2"
echo "extension=phalcon.so" >> "$ini_file"
fi