Skip to content

Commit a507be7

Browse files
authored
Merge pull request #127 from shivammathur/develop
Hotfix to support phalcon after v4 release
2 parents 0969980 + 673dcaf commit a507be7

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

__tests__/extensions.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@ describe('Extension tests', () => {
5151
'7.2',
5252
'linux'
5353
);
54+
expect(linux).toContain('phalcon.sh 3.4.x 7.2');
5455
expect(linux).toContain('phalcon.sh master 7.2');
55-
expect(linux).toContain('phalcon.sh 4.0.x 7.2');
5656
expect(linux).toContain('gearman.sh 7.2');
5757

5858
linux = await extensions.addExtension(
5959
'phalcon3, phalcon4, gearman',
6060
'7.3',
6161
'linux'
6262
);
63+
expect(linux).toContain('phalcon.sh 3.4.x 7.3');
6364
expect(linux).toContain('phalcon.sh master 7.3');
64-
expect(linux).toContain('phalcon.sh 4.0.x 7.3');
6565
expect(linux).toContain('gearman.sh 7.3');
6666

6767
linux = await extensions.addExtension('phalcon4, gearman', '7.4', 'linux');
68-
expect(linux).toContain('phalcon.sh 4.0.x 7.4');
68+
expect(linux).toContain('phalcon.sh master 7.4');
6969
expect(linux).toContain('gearman.sh 7.4');
7070

7171
linux = await extensions.addExtension('xdebug', '7.2', 'fedora');

dist/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2270,7 +2270,7 @@ function addExtensionLinux(extension_csv, version) {
22702270
install_command =
22712271
'sh ' +
22722272
path.join(__dirname, '../src/scripts/phalcon.sh') +
2273-
' master ' +
2273+
' 3.4.x ' +
22742274
version +
22752275
' >/dev/null 2>&1';
22762276
break;
@@ -2280,7 +2280,7 @@ function addExtensionLinux(extension_csv, version) {
22802280
install_command =
22812281
'sh ' +
22822282
path.join(__dirname, '../src/scripts/phalcon.sh') +
2283-
' 4.0.x ' +
2283+
' master ' +
22842284
version +
22852285
' >/dev/null 2>&1';
22862286
break;

src/extensions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export async function addExtensionLinux(
9292
install_command =
9393
'sh ' +
9494
path.join(__dirname, '../src/scripts/phalcon.sh') +
95-
' master ' +
95+
' 3.4.x ' +
9696
version +
9797
' >/dev/null 2>&1';
9898
break;
@@ -102,7 +102,7 @@ export async function addExtensionLinux(
102102
install_command =
103103
'sh ' +
104104
path.join(__dirname, '../src/scripts/phalcon.sh') +
105-
' 4.0.x ' +
105+
' master ' +
106106
version +
107107
' >/dev/null 2>&1';
108108
break;

src/scripts/phalcon.sh

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
2+
ini_dir=$(php --ini | grep in: | sed -e "s|.*:s*||" | sed "s/ //g")
23
if [ ! "$(apt-cache search php"$2"-psr)" ]; then
34
sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y >/dev/null 2>&1
45
fi
5-
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev php"$2"-psr
6+
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev
7+
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-psr
68
for tool in php-config phpize; do
79
if [ -e "/usr/bin/$tool$2" ]; then
810
sudo update-alternatives --set $tool /usr/bin/"$tool$2"
@@ -17,10 +19,6 @@ if [ ! "$(apt-cache search php"$2"-psr)" ]; then
1719
echo "extension=psr.so" >> "$ini_file"
1820
fi
1921

20-
if [ "$1" = "master" ]; then
21-
sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-phalcon
22-
else
23-
cd ~ && git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1"
24-
cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2"
25-
echo "extension=phalcon.so" >> "$ini_file"
26-
fi
22+
cd ~ && git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1"
23+
cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2"
24+
echo "extension=phalcon.so" | sudo tee "$ini_dir/50-phalcon.ini"

0 commit comments

Comments
 (0)