From 326dfd1e76eb31eda0cd9035d68f8fb88cd1d2e5 Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Wed, 5 Feb 2020 20:58:44 +0530
Subject: [PATCH 01/13] Add support for old PHP versions on darwin
---
__tests__/extensions.test.ts | 9 +++
dist/index.js | 8 ++-
package-lock.json | 44 +++++++--------
package.json | 6 +-
src/extensions.ts | 8 ++-
src/scripts/darwin.sh | 106 +++++++++++++++++++++++++++--------
6 files changed, 132 insertions(+), 49 deletions(-)
diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts
index e83efbf7..e1191c0b 100644
--- a/__tests__/extensions.test.ts
+++ b/__tests__/extensions.test.ts
@@ -84,6 +84,15 @@ describe('Extension tests', () => {
darwin = await extensions.addExtension('pcov', '7.2', 'darwin');
expect(darwin).toContain('sudo pecl install -f pcov');
+ darwin = await extensions.addExtension('xdebug', '5.3', 'darwin');
+ expect(darwin).toContain('sudo pecl install -f xdebug-2.2.7');
+
+ darwin = await extensions.addExtension('xdebug', '5.4', 'darwin');
+ expect(darwin).toContain('sudo pecl install -f xdebug-2.4.1');
+
+ darwin = await extensions.addExtension('xdebug', '5.5', 'darwin');
+ expect(darwin).toContain('sudo pecl install -f xdebug-2.5.5');
+
darwin = await extensions.addExtension('xdebug', '5.6', 'darwin');
expect(darwin).toContain('sudo pecl install -f xdebug-2.5.5');
diff --git a/dist/index.js b/dist/index.js
index 5525fcea..dc3d507f 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -2663,7 +2663,13 @@ function addExtensionDarwin(extension_csv, version, pipe) {
' ' +
prefix;
return;
- case /5\.6xdebug/.test(version_extension):
+ case /5\.3xdebug/.test(version_extension):
+ install_command = 'sudo pecl install -f xdebug-2.2.7' + pipe;
+ break;
+ case /5\.4xdebug/.test(version_extension):
+ install_command = 'sudo pecl install -f xdebug-2.4.1' + pipe;
+ break;
+ case /5\.[5-6]xdebug/.test(version_extension):
install_command = 'sudo pecl install -f xdebug-2.5.5' + pipe;
break;
case /7\.0xdebug/.test(version_extension):
diff --git a/package-lock.json b/package-lock.json
index 860ea479..d8710f6b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -711,12 +711,12 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
- "version": "2.18.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.18.0.tgz",
- "integrity": "sha512-kuO8WQjV+RCZvAXVRJfXWiJ8iYEtfHlKgcqqqXg9uUkIolEHuUaMmm8/lcO4xwCOtaw6mY0gStn2Lg4/eUXXYQ==",
+ "version": "2.19.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.0.tgz",
+ "integrity": "sha512-u7IcQ9qwsB6U806LupZmINRnQjC+RJyv36sV/ugaFWMHTbFm/hlLTRx3gGYJgHisxcGSTnf+I/fPDieRMhPSQQ==",
"dev": true,
"requires": {
- "@typescript-eslint/experimental-utils": "2.18.0",
+ "@typescript-eslint/experimental-utils": "2.19.0",
"eslint-utils": "^1.4.3",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0",
@@ -724,32 +724,32 @@
}
},
"@typescript-eslint/experimental-utils": {
- "version": "2.18.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.18.0.tgz",
- "integrity": "sha512-J6MopKPHuJYmQUkANLip7g9I82ZLe1naCbxZZW3O2sIxTiq/9YYoOELEKY7oPg0hJ0V/AQ225h2z0Yp+RRMXhw==",
+ "version": "2.19.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.0.tgz",
+ "integrity": "sha512-zwpg6zEOPbhB3+GaQfufzlMUOO6GXCNZq6skk+b2ZkZAIoBhVoanWK255BS1g5x9bMwHpLhX0Rpn5Fc3NdCZdg==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
- "@typescript-eslint/typescript-estree": "2.18.0",
+ "@typescript-eslint/typescript-estree": "2.19.0",
"eslint-scope": "^5.0.0"
}
},
"@typescript-eslint/parser": {
- "version": "2.18.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.18.0.tgz",
- "integrity": "sha512-SJJPxFMEYEWkM6pGfcnjLU+NJIPo+Ko1QrCBL+i0+zV30ggLD90huEmMMhKLHBpESWy9lVEeWlQibweNQzyc+A==",
+ "version": "2.19.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.19.0.tgz",
+ "integrity": "sha512-s0jZoxAWjHnuidbbN7aA+BFVXn4TCcxEVGPV8lWMxZglSs3NRnFFAlL+aIENNmzB2/1jUJuySi6GiM6uACPmpg==",
"dev": true,
"requires": {
"@types/eslint-visitor-keys": "^1.0.0",
- "@typescript-eslint/experimental-utils": "2.18.0",
- "@typescript-eslint/typescript-estree": "2.18.0",
+ "@typescript-eslint/experimental-utils": "2.19.0",
+ "@typescript-eslint/typescript-estree": "2.19.0",
"eslint-visitor-keys": "^1.1.0"
}
},
"@typescript-eslint/typescript-estree": {
- "version": "2.18.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.18.0.tgz",
- "integrity": "sha512-gVHylf7FDb8VSi2ypFuEL3hOtoC4HkZZ5dOjXvVjoyKdRrvXAOPSzpNRnKMfaUUEiSLP8UF9j9X9EDLxC0lfZg==",
+ "version": "2.19.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.0.tgz",
+ "integrity": "sha512-n6/Xa37k0jQdwpUszffi19AlNbVCR0sdvCs3DmSKMD7wBttKY31lhD2fug5kMD91B2qW4mQldaTEc1PEzvGu8w==",
"dev": true,
"requires": {
"debug": "^4.1.1",
@@ -3036,9 +3036,9 @@
"dev": true
},
"istanbul-lib-instrument": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.0.tgz",
- "integrity": "sha512-Nm4wVHdo7ZXSG30KjZ2Wl5SU/Bw7bDx1PdaiIFzEStdjs0H12mOTncn1GVYuqQSaZxpg87VGBRsVRPGD2cD1AQ==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz",
+ "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==",
"dev": true,
"requires": {
"@babel/core": "^7.7.5",
@@ -5524,9 +5524,9 @@
}
},
"ts-jest": {
- "version": "25.1.0",
- "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-25.1.0.tgz",
- "integrity": "sha512-1Lf576ulKhbxX5og+tG8udVg/5cgcMLPBxp1iCqbbf6VvUK4gEsgAtzMjl8u98izhLrzKMPB0LxCBKEZ5l19Hw==",
+ "version": "25.2.0",
+ "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-25.2.0.tgz",
+ "integrity": "sha512-VaRdb0da46eorLfuHEFf0G3d+jeREcV+Wb/SvW71S4y9Oe8SHWU+m1WY/3RaMknrBsnvmVH0/rRjT8dkgeffNQ==",
"dev": true,
"requires": {
"bs-logger": "0.x",
diff --git a/package.json b/package.json
index 1ffed5cb..8bdd36c0 100644
--- a/package.json
+++ b/package.json
@@ -32,8 +32,8 @@
"devDependencies": {
"@types/jest": "^25.1.1",
"@types/node": "^13.7.0",
- "@typescript-eslint/eslint-plugin": "^2.18.0",
- "@typescript-eslint/parser": "^2.18.0",
+ "@typescript-eslint/eslint-plugin": "^2.19.0",
+ "@typescript-eslint/parser": "^2.19.0",
"@zeit/ncc": "^0.21.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
@@ -44,7 +44,7 @@
"jest": "^25.1.0",
"jest-circus": "^25.1.0",
"prettier": "^1.19.1",
- "ts-jest": "^25.1.0",
+ "ts-jest": "^25.2.0",
"typescript": "^3.7.5"
},
"husky": {
diff --git a/src/extensions.ts b/src/extensions.ts
index 86cb4144..246c8f82 100644
--- a/src/extensions.ts
+++ b/src/extensions.ts
@@ -32,7 +32,13 @@ export async function addExtensionDarwin(
' ' +
prefix;
return;
- case /5\.6xdebug/.test(version_extension):
+ case /5\.3xdebug/.test(version_extension):
+ install_command = 'sudo pecl install -f xdebug-2.2.7' + pipe;
+ break;
+ case /5\.4xdebug/.test(version_extension):
+ install_command = 'sudo pecl install -f xdebug-2.4.1' + pipe;
+ break;
+ case /5\.[5-6]xdebug/.test(version_extension):
install_command = 'sudo pecl install -f xdebug-2.5.5' + pipe;
break;
case /7\.0xdebug/.test(version_extension):
diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh
index d2972565..9f88a97b 100644
--- a/src/scripts/darwin.sh
+++ b/src/scripts/darwin.sh
@@ -29,12 +29,18 @@ add_extension() {
install_command=$2
prefix=$3
if ! php -m | grep -i -q -w "$extension" && [ -e "$ext_dir/$extension.so" ]; then
- echo "$prefix=$extension" >>"$ini_file" && add_log "$tick" "$extension" "Enabled"
+ echo "$prefix=$ext_dir/$extension.so" >>"$ini_file" && add_log "$tick" "$extension" "Enabled"
elif php -m | grep -i -q -w "$extension"; then
add_log "$tick" "$extension" "Enabled"
elif ! php -m | grep -i -q -w "$extension"; then
- (eval "$install_command" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
- add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
+ if [[ "$version" =~ $old_versions ]]; then
+ (eval "$install_command" >/dev/null 2>&1 && echo "$prefix=$ext_dir/$extension.so" >>"$ini_file" && add_log "$tick" "$extension" "Installed and enabled") ||
+ (sudo port install php"$nodot_version"-"$extension" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
+ add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
+ else
+ (eval "$install_command" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
+ add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
+ fi
fi
}
@@ -101,7 +107,7 @@ add_tool() {
add_extension xml >/dev/null 2>&1
elif [ "$tool" = "cs2pr" ]; then
sudo sed -i '' 's/exit(9)/exit(0)/' "$tool_path"
- tr -d '\r' < "$tool_path" | sudo tee "$tool_path" >/dev/null 2>&1
+ tr -d '\r' < "$tool_path" | sudo tee "$tool_path.tmp" >/dev/null 2>&1 && sudo mv "$tool_path.tmp" "$tool_path"
fi
add_log "$tick" "$tool" "Added"
else
@@ -124,11 +130,13 @@ add_composer_tool() {
# Function to configure PECL
configure_pecl() {
- for tool in pear pecl; do
- sudo "$tool" config-set php_ini "$ini_file" >/dev/null 2>&1
- sudo "$tool" config-set auto_discover 1 >/dev/null 2>&1
- sudo "$tool" channel-update "$tool".php.net >/dev/null 2>&1
- done
+ if [[ ! "$version" =~ $old_versions ]]; then
+ for tool in pear pecl; do
+ sudo "$tool" config-set php_ini "$ini_file" >/dev/null 2>&1
+ sudo "$tool" config-set auto_discover 1 >/dev/null 2>&1
+ sudo "$tool" channel-update "$tool".php.net >/dev/null 2>&1
+ done
+ fi
}
# Function to log PECL, it is installed along with PHP
@@ -136,27 +144,81 @@ add_pecl() {
add_log "$tick" "PECL" "Added"
}
-# Function to setup PHP and composer
-setup_php_and_composer() {
- export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
- brew tap shivammathur/homebrew-php >/dev/null 2>&1
- brew install shivammathur/php/php@"$version" >/dev/null 2>&1
- brew link --force --overwrite php@"$version" >/dev/null 2>&1
+# Function to add PECL when macports is used
+add_pecl_old() {
+ pecl_version='master'
+ if [ "$1" = "53" ]; then
+ pecl_version='v1.9.5'
+ fi
+ curl -o pear.phar -sSL https://github.com/pear/pearweb_phars/raw/$pecl_version/install-pear-nozlib.phar
+ sudo php pear.phar -d /opt/local/lib/php$1 -b /usr/local/bin && rm -rf pear.phar
+}
+
+add_macports() {
+ uri=$(curl -sSL https://github.com/macports/macports-base/releases | grep -Eo "(\/.*Catalina.pkg)" | head -n 1)
+ curl -o port.pkg -sSL https://github.com"$uri"
+ sudo installer -pkg port.pkg -target / && rm -rf port.pkg
+}
+
+sync_macports() {
+ while true; do
+ status=0
+ sudo port sync || status=$?
+ if [[ "$status" -eq 0 ]]; then
+ break
+ fi
+ sleep 2
+ done
+}
+
+port_setup_php() {
+ sudo port install php$1 php$1-curl php$1-mbstring php$1-xmlrpc php$1-openssl php$1-opcache
+ sudo cp /opt/local/etc/php$1/php.ini-development /opt/local/etc/php$1/php.ini
+ sudo port select --set php php$1
+ sudo ln -sf /opt/local/bin/* /usr/local/bin
+ add_pecl_old "$1"
+}
+
+# Function to setup PHP
+setup_php() {
+ if [[ "$version" =~ $old_versions ]]; then
+ step_log "Setup Macports"
+ add_macports >/dev/null 2>&1
+ add_log "$tick" "Macports" "Installed"
+ sync_macports >/dev/null 2>&1
+ add_log "$tick" "Macports" "Synced"
+
+ step_log "Setup PHP"
+ port_setup_php $nodot_version >/dev/null 2>&1
+ else
+ step_log "Setup PHP"
+ export HOMEBREW_NO_INSTALL_CLEANUP=TRUE >/dev/null 2>&1
+ brew tap shivammathur/homebrew-php >/dev/null 2>&1
+ brew install shivammathur/php/php@"$version" >/dev/null 2>&1
+ brew link --force --overwrite php@"$version" >/dev/null 2>&1
+ fi
}
# Variables
tick="✓"
cross="✗"
version=$1
+nodot_version=${1/./}
+old_versions="5.[3-5]"
-# Setup PHP and composer
-step_log "Setup PHP"
-setup_php_and_composer
+# Setup Environment
+if [[ "$version" =~ $old_versions ]]; then
+ export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
+ export TERM=xterm
+fi
+
+# Setup PHP
+setup_php
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
-echo "date.timezone=UTC" >>"$ini_file"
-ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
sudo chmod 777 "$ini_file"
-mkdir -p "$(pecl config-get ext_dir)"
+echo "date.timezone=UTC" >>"$ini_file"
+ext_dir=$(php -i | grep -Ei "extension_dir => /(usr|opt)" | sed -e "s|.*=> s*||")
+sudo mkdir -p "$ext_dir"
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
-add_log "$tick" "PHP" "Installed PHP $semver"
configure_pecl
+add_log "$tick" "PHP" "Installed PHP $semver"
\ No newline at end of file
From 3c6644f237c0feaa0a2cce9f059e05009ae19deb Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Thu, 6 Feb 2020 05:24:45 +0530
Subject: [PATCH 02/13] Add support for old PHP versions on windows
---
src/scripts/win32.ps1 | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1
index 082fbe94..19eef46e 100644
--- a/src/scripts/win32.ps1
+++ b/src/scripts/win32.ps1
@@ -91,10 +91,7 @@ Function Add-Tool() {
if (Test-Path $php_dir\$tool) {
Remove-Item $php_dir\$tool
}
- if ($tool -eq "composer") {
- Install-Composer -Scope System -Path $php_dir -PhpPath $php_dir
- composer -q global config process-timeout 0
- } elseif ($tool -eq "symfony") {
+ if ($tool -eq "symfony") {
Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $php_dir\$tool.exe
Add-Content -Path $PsHome\profile.ps1 -Value "New-Alias $tool $php_dir\$tool.exe" > $null 2>&1
} else {
@@ -113,9 +110,10 @@ Function Add-Tool() {
Add-Extension curl >$null 2>&1
Add-Extension mbstring >$null 2>&1
Add-Extension xml >$null 2>&1
- }
- if($tool -eq "cs2pr") {
+ } elseif($tool -eq "cs2pr") {
(Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr
+ } elseif($tool -eq "composer") {
+ composer -q global config process-timeout 0
}
if (((Get-ChildItem -Path $php_dir/* | Where-Object Name -Match "^$tool(.exe|.phar)*$").Count -gt 0)) {
Add-Log $tick $tool "Added"
@@ -202,7 +200,12 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
$installed = Get-Php -Path $php_dir
Set-PhpIniKey -Key 'date.timezone' -Value 'UTC' -Path $php_dir
-Enable-PhpExtension -Extension openssl, curl, opcache -Path $php_dir
+if($version -lt "5.5") {
+ Add-Extension openssl >$null 2>&1
+ Add-Extension curl >$null 2>&1
+} else {
+ Enable-PhpExtension -Extension openssl, curl, opcache -Path $php_dir
+}
Update-PhpCAInfo -Path $php_dir -Source CurrentUser
if ($version -eq 'master') {
if($installed.ThreadSafe) {
From ca33d01e9f8ae2c8d24af2bd31935bdd4df1fd53 Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Sun, 9 Feb 2020 04:08:48 +0530
Subject: [PATCH 03/13] Add support for old PHP versions on linux
---
__tests__/extensions.test.ts | 2 +-
__tests__/install.test.ts | 18 +-
__tests__/tools.test.ts | 73 ++--
builds | 607 ++++++++++++++++++++++++++++++++++
dist/index.js | 70 ++--
src/coverage.ts | 6 +-
src/extensions.ts | 2 +-
src/install.ts | 2 +-
src/scripts/darwin.sh | 9 +-
src/scripts/ext/extensions.sh | 76 ++++-
src/scripts/linux.sh | 68 +++-
src/tools.ts | 60 +++-
update.zip | Bin 2879 -> 0 bytes
13 files changed, 893 insertions(+), 100 deletions(-)
create mode 100644 builds
delete mode 100644 update.zip
diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts
index e1191c0b..03491255 100644
--- a/__tests__/extensions.test.ts
+++ b/__tests__/extensions.test.ts
@@ -31,7 +31,7 @@ describe('Extension tests', () => {
'7.4',
'linux'
);
- expect(linux).toContain('update_extension xdebug 2.9.0');
+ expect(linux).toContain('update_extension xdebug 2.9.1');
expect(linux).toContain(
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-pcov'
);
diff --git a/__tests__/install.test.ts b/__tests__/install.test.ts
index 45119282..f48dcd2b 100644
--- a/__tests__/install.test.ts
+++ b/__tests__/install.test.ts
@@ -46,7 +46,7 @@ jest.mock('../src/install', () => ({
case 'darwin':
case 'linux':
script = await install.build(os_version + '.sh', version, os_version);
- script += 'sh script.sh ' + version + ' ' + __dirname;
+ script += 'bash script.sh ' + version + ' ' + __dirname;
break;
case 'win32':
script = await install.build(os_version + '.sh', version, os_version);
@@ -117,7 +117,7 @@ describe('Install', () => {
// @ts-ignore
let script: string = await install.run();
expect(script).toContain('initial script');
- expect(script).toContain('sh script.sh 7.3 ');
+ expect(script).toContain('bash script.sh 7.3 ');
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit', 'true');
// @ts-ignore
@@ -126,7 +126,7 @@ describe('Install', () => {
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
- expect(script).toContain('sh script.sh 7.3');
+ expect(script).toContain('bash script.sh 7.3');
expect(script).toContain('add_tool');
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit', '');
@@ -136,7 +136,7 @@ describe('Install', () => {
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
- expect(script).toContain('sh script.sh 7.3');
+ expect(script).toContain('bash script.sh 7.3');
expect(script).toContain('add_tool');
});
@@ -145,7 +145,7 @@ describe('Install', () => {
// @ts-ignore
let script: string = await install.run();
expect(script).toContain('initial script');
- expect(script).toContain('sh script.sh 7.3 ' + __dirname);
+ expect(script).toContain('bash script.sh 7.3 ' + __dirname);
setEnv('7.3', 'darwin', 'a, b', 'a=b', 'x', '', '');
// @ts-ignore
@@ -154,7 +154,7 @@ describe('Install', () => {
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
- expect(script).toContain('sh script.sh 7.3 ' + __dirname);
+ expect(script).toContain('bash script.sh 7.3 ' + __dirname);
});
it('Test malformed version inputs', async () => {
@@ -162,18 +162,18 @@ describe('Install', () => {
// @ts-ignore
let script: string = await install.run();
expect(script).toContain('initial script');
- expect(script).toContain('sh script.sh 7.4 ' + __dirname);
+ expect(script).toContain('bash script.sh 7.4 ' + __dirname);
setEnv(8.0, 'darwin', '', '', '', '', '');
// @ts-ignore
script = await install.run();
expect(script).toContain('initial script');
- expect(script).toContain('sh script.sh 8.0 ' + __dirname);
+ expect(script).toContain('bash script.sh 8.0 ' + __dirname);
setEnv(8, 'darwin', '', '', '', '', '');
// @ts-ignore
script = await install.run();
expect(script).toContain('initial script');
- expect(script).toContain('sh script.sh 8.0 ' + __dirname);
+ expect(script).toContain('bash script.sh 8.0 ' + __dirname);
});
});
diff --git a/__tests__/tools.test.ts b/__tests__/tools.test.ts
index 6c7394dd..c6aadaa1 100644
--- a/__tests__/tools.test.ts
+++ b/__tests__/tools.test.ts
@@ -107,22 +107,13 @@ describe('Tools tests', () => {
});
it('checking getCodeceptionUriBuilder', async () => {
- expect(await tools.getCodeceptionUriBuilder('3.2.1', '5.6', 'php56')).toBe(
+ expect(await tools.getCodeceptionUriBuilder('3.2.1', 'php56')).toBe(
'releases/3.2.1/php56/codecept.phar'
);
- expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.0', 'php54')).toBe(
+ expect(await tools.getCodeceptionUriBuilder('3.2.1', 'php54')).toBe(
'releases/3.2.1/php54/codecept.phar'
);
- expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.1', 'php56')).toBe(
- 'releases/3.2.1/php56/codecept.phar'
- );
- expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.2', 'php56')).toBe(
- 'releases/3.2.1/codecept.phar'
- );
- expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.3', 'php56')).toBe(
- 'releases/3.2.1/codecept.phar'
- );
- expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.4', 'php56')).toBe(
+ expect(await tools.getCodeceptionUriBuilder('3.2.1', '')).toBe(
'releases/3.2.1/codecept.phar'
);
});
@@ -146,17 +137,59 @@ describe('Tools tests', () => {
expect(await tools.getCodeceptionUri('latest', '7.4')).toBe(
'codecept.phar'
);
- expect(await tools.getCodeceptionUri('3.2.1', '5.6')).toBe(
- 'releases/3.2.1/php54/codecept.phar'
+ expect(await tools.getCodeceptionUri('4.0.0', '7.4')).toBe(
+ 'releases/4.0.0/codecept.phar'
);
- expect(await tools.getCodeceptionUri('4.3.2', '5.6')).toBe(
- 'releases/4.3.2/php56/codecept.phar'
+ expect(await tools.getCodeceptionUri('4.0.0', '5.6')).toBe(
+ 'releases/4.0.0/php56/codecept.phar'
);
- expect(await tools.getCodeceptionUri('3.2.1', '7.4')).toBe(
- 'releases/3.2.1/codecept.phar'
+ expect(await tools.getCodeceptionUri('4.0.0', '7.1')).toBe(
+ 'releases/4.0.0/php56/codecept.phar'
);
- expect(await tools.getCodeceptionUri('4.3.2', '7.4')).toBe(
- 'releases/4.3.2/codecept.phar'
+ expect(await tools.getCodeceptionUri('3.1.0', '7.4')).toBe(
+ 'releases/3.1.0/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('3.1.0', '5.6')).toBe(
+ 'releases/3.1.0/php54/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.5.4', '7.4')).toBe(
+ 'releases/2.5.4/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.5.4', '5.6')).toBe(
+ 'releases/2.5.4/php54/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.3.4', '7.4')).toBe(
+ 'releases/2.3.4/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.3.4', '5.4')).toBe(
+ 'releases/2.3.4/php54/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.2.4', '5.6')).toBe(
+ 'releases/2.2.4/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.2.4', '7.4')).toBe(
+ 'releases/2.2.4/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.2.4', '5.4')).toBe(
+ 'releases/2.2.4/php54/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.1.7', '5.6')).toBe(
+ 'releases/2.1.7/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.1.7', '5.4')).toBe(
+ 'releases/2.1.7/php54/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.1.5', '5.4')).toBe(
+ 'releases/2.1.5/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('2.1.5', '7.4')).toBe(
+ 'releases/2.1.5/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('1.6.9', '7.4')).toBe(
+ 'releases/1.6.9/codecept.phar'
+ );
+ expect(await tools.getCodeceptionUri('1.5.0', '7.4')).toBe(
+ 'releases/1.5.0/codecept.phar'
);
});
diff --git a/builds b/builds
new file mode 100644
index 00000000..00771115
--- /dev/null
+++ b/builds
@@ -0,0 +1,607 @@
+
+
+
+
+
+ Codeception Builds
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross platform interface to setup the PHP environment you need to test your application. Refer to [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this.
@@ -24,25 +24,32 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
- [Coverage support](#signal_strength-coverage-support)
- [Xdebug](#xdebug)
- [PCOV](#pcov)
- - [Disable coverage](#disable-coverage)
+ - [Disable Coverage](#disable-coverage)
- [Usage](#memo-usage)
+ - [Inputs](#inputs)
- [Basic Setup](#basic-setup)
- [Matrix Setup](#matrix-setup)
- - [Experimental Setup](#experimental-setup)
- - [Thread Safe Setup](#thread-safe-setup)
- - [Cache dependencies](#cache-dependencies)
+ - [Experimental Setup](#experimental-setup)
+ - [Thread Safe Setup](#thread-safe-setup)
+ - [Force Update](#force-update)
+ - [Verbose Setup](#verbose-setup)
+ - [Cache Extensions](#cache-extensions)
+ - [Cache Composer Dependencies](#cache-composer-dependencies)
- [Problem Matchers](#problem-matchers)
- [Examples](#examples)
- [License](#scroll-license)
- [Contributions](#1-contributions)
-- [Support this project](#sparkling_heart-support-this-project)
-- [This action uses the following works](#bookmark-this-action-uses-the-following-works)
+- [Support This Project](#sparkling_heart-support-this-project)
+- [Dependencies](#bookmark-dependencies)
- [Further Reading](#bookmark_tabs-further-reading)
## :tada: PHP Support
|PHP Version|Stability|Release Support|
|--- |--- |--- |
+|5.3|`Stable`|`End of life`|
+|5.4|`Stable`|`End of life`|
+|5.5|`Stable`|`End of life`|
|5.6|`Stable`|`End of life`|
|7.0|`Stable`|`End of life`|
|7.1|`Stable`|`End of life`|
@@ -64,10 +71,41 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
## :heavy_plus_sign: PHP Extension Support
- On `ubuntu` by default extensions which are available as a package can be installed. If the extension is not available as a package but it is on `PECL`, it can be installed by specifying `pecl` in the tools input.
+
+```yaml
+uses: shivammathur/setup-php@v2
+with:
+ php-version: '7.4'
+ tools: pecl
+ extensions: swoole
+```
+
- On `windows` extensions which have `windows` binary on `PECL` can be installed.
+
- On `macOS` extensions which are on `PECL` can be installed.
+
- Extensions which are installed along with PHP if specified are enabled.
-- Extensions on `PECL` which do not have a latest stable version, their pre-release versions can be installed by suffixing the extension with its state i.e `alpha`, `beta`, `devel` or `snapshot` separated by a `-` like `msgpack-beta`.
+
+- Specific versions of PECL extensions can be installed by suffixing the extension with the version. This is useful for installing old versions of extensions which support end of life PHP versions.
+
+```yaml
+uses: shivammathur/setup-php@v2
+with:
+ php-version: '7.4'
+ tools: pecl
+ extensions: pcov-1.0.6
+```
+
+- Pre-release versions of PECL extensions can be installed by suffixing the extension with its state i.e `alpha`, `beta`, `devel` or `snapshot`.
+
+```yaml
+uses: shivammathur/setup-php@v2
+with:
+ php-version: '7.4'
+ tools: pecl
+ extensions: xdebug-beta
+```
+
- Extensions which cannot be installed gracefully leave an error message in the logs, the action is not interrupted.
## :wrench: Tools Support
@@ -77,7 +115,7 @@ These tools can be setup globally using the `tools` input.
`codeception`, `composer`, `composer-prefetcher`, `cs2pr`, `deployer`, `pecl`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`, `symfony`
```yaml
-uses: shivammathur/setup-php@v1
+uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: php-cs-fixer, phpunit
@@ -87,7 +125,7 @@ To setup a particular version of a tool, specify it in the form `tool:version`.
Version should be in semver format and a valid release of the tool.
```yaml
-uses: shivammathur/setup-php@v1
+uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: php-cs-fixer:2.15.5, phpunit:8.5.1
@@ -95,7 +133,7 @@ with:
**Note**
- `composer` is setup by default.
-- Specifying version for `composer` and `pecl` has no effect, latest version of both tools will be setup.
+- Specifying version for `composer` and `pecl` has no effect, latest versions of both tools which are compatible with the PHP version will be setup.
- If the version specified for the tool is not in semver format, latest version of the tool will be setup.
- Tools which cannot be installed gracefully leave an error message in the logs, the action is not interrupted.
@@ -107,7 +145,7 @@ Specify `coverage: xdebug` to use `Xdebug`.
Runs on all [PHP versions supported](#tada-php-support "List of PHP versions supported on this GitHub Action") except `8.0`.
```yaml
-uses: shivammathur/setup-php@v1
+uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: xdebug
@@ -120,18 +158,17 @@ It is much faster than `Xdebug`.
`PCOV` needs `PHP >= 7.1`.
If your source code directory is other than `src`, `lib` or, `app`, specify `pcov.directory` using the `ini-values` input.
-
```yaml
-uses: shivammathur/setup-php@v1
+uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
ini-values: pcov.directory=api #optional, see above for usage.
coverage: pcov
```
-### Disable coverage
+### Disable Coverage
-Specify `coverage: none` to disable both `Xdebug` and `PCOV`.
+Specify `coverage: none` to remove both `Xdebug` and `PCOV`.
Consider disabling the coverage using this PHP action for these reasons.
- You are not generating coverage reports while testing.
@@ -139,7 +176,7 @@ Consider disabling the coverage using this PHP action for these reasons.
- You are using `phpdbg` for running your tests.
```yaml
-uses: shivammathur/setup-php@v1
+uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
@@ -147,15 +184,38 @@ with:
## :memo: Usage
-Inputs supported by this GitHub Action.
+### Inputs
-- php-version `required`
-- extensions `optional`
-- ini-values `optional`
-- coverage `optional`
-- tools `optional`
+#### `php-version` (required)
-See [action.yml](action.yml "Metadata for this GitHub Action") and usage below for more info.
+- Specify the PHP version you want to setup.
+- Accepts a `string`. For example `'7.4'`.
+- See [PHP support](#tada-php-support) for supported PHP versions.
+
+#### `extensions` (optional)
+
+- Specify the extensions you want to setup.
+- Accepts a `string` in csv-format. For example `mbstring, zip`.
+- See [PHP extension support](#heavy_plus_sign-php-extension-support) for more info.
+
+#### `ini-values` (optional)
+
+- Specify the values you want to add to `php.ini`.
+- Accepts a `string` in csv-format. For example `post_max_size=256M, short_open_tag=On`.
+
+#### `coverage` (optional)
+
+- Specify the code coverage driver you want to setup.
+- Accepts `xdebug`, `pcov` or `none`.
+- See [coverage support](#signal_strength-coverage-support) for more info.
+
+#### `tools` (optional)
+
+- Specify the tools you want to setup.
+- Accepts a `string` in csv-format. For example `phpunit, phpcs`
+- See [tools Support](#wrench-tools-support) for tools supported.
+
+See below for more info.
### Basic Setup
@@ -167,13 +227,13 @@ steps:
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- extensions: mbstring, intl #optional, setup extensions
- ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
- coverage: xdebug #optional, setup coverage driver
- tools: php-cs-fixer, phpunit #optional, setup tools globally
+ extensions: mbstring, intl
+ ini-values: post_max_size=256M, short_open_tag=On
+ coverage: xdebug
+ tools: php-cs-fixer, phpunit
```
### Matrix Setup
@@ -194,13 +254,13 @@ jobs:
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- extensions: mbstring, intl #optional, setup extensions
- ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
- coverage: xdebug #optional, setup coverage driver
- tools: php-cs-fixer, phpunit #optional, setup tools globally
+ extensions: mbstring, intl
+ ini-values: post_max_size=256M, short_open_tag=On
+ coverage: xdebug
+ tools: php-cs-fixer, phpunit
```
### Experimental Setup
@@ -219,13 +279,13 @@ steps:
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- extensions: mbstring #optional, setup extensions
- ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1 #optional, setup php.ini configuration
- coverage: pcov #optional, setup PCOV, Xdebug does not support this version yet.
- tools: php-cs-fixer, phpunit #optional, setup tools globally
+ extensions: mbstring
+ ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1
+ coverage: pcov
+ tools: php-cs-fixer, phpunit
```
### Thread Safe Setup
@@ -244,14 +304,79 @@ jobs:
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
env:
PHPTS: ts # specify ts or nts
```
-### Cache dependencies
+### Force Update
+
+- PHP versions which are pre-installed on the GitHub Actions runner are not updated to their latest patch release by default.
+- You can specify the `update` environment variable to `true` to force update to the latest release.
+
+```yaml
+- name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: '7.4'
+ env:
+ update: true # specify true or false
+```
+
+### Verbose Setup
+
+- To debug any issues, you can use the `verbose` tag instead of `v2`.
+
+```yaml
+- name: Setup PHP
+ uses: shivammathur/setup-php@verbose
+ with:
+ php-version: '7.4'
+```
+
+### Cache Extensions
+
+You can persist PHP extensions you setup using the [`shivammathur/cache-extensions`](https://github.com/shivammathur/cache-extensions "GitHub Action to cache php extensions") and [`action/cache`](https://github.com/actions/cache "GitHub Action to cache files") GitHub Actions. Extensions which take very long to setup if cached are available in the next workflow run and enabled directly which reduces the workflow execution time.
+
+```yaml
+runs-on: ${{ matrix.operating-system }}
+strategy:
+ matrix:
+ operating-system: [ubuntu-latest, windows-latest, macos-latest]
+ php-versions: ['7.2', '7.3', '7.4']
+name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
+env:
+ extensions: intl, pcov
+ key: cache-v1 # can be any string, change to clear the extension cache.
+steps:
+- name: Checkout
+ uses: actions/checkout@v2
+
+- name: Setup cache environment
+ id: cache-env
+ uses: shivammathur/cache-extensions@v1
+ with:
+ php-version: ${{ matrix.php-versions }}
+ extensions: ${{ env.extensions }}
+ key: ${{ env.key }}
+
+- name: Cache extensions
+ uses: actions/cache@v1
+ with:
+ path: ${{ steps.cache-env.outputs.dir }}
+ key: ${{ steps.cache-env.outputs.key }}
+ restore-keys: ${{ steps.cache-env.outputs.key }}
+
+- name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-versions }}
+ extensions: ${{ env.extensions }}
+```
+
+### Cache Composer Dependencies
You can persist composer's internal cache directory using the [`action/cache`](https://github.com/actions/cache "GitHub Action to cache files") GitHub Action. Dependencies cached are loaded directly instead of downloading them while installation. The files cached are available across check-runs and will reduce the workflow execution time.
@@ -281,16 +406,25 @@ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
### Problem Matchers
+#### PHP
+
+Setup problem matchers for your `PHP` output by adding this step after the `setup-php` step. This will scan the logs for PHP errors and warnings, and surface them prominently in the GitHub Actions UI by creating annotations and log file decorations.
+
+```yaml
+- name: Setup Problem Matchers for PHP
+ run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
+```
+
#### PHPUnit
-You can setup problem matchers for your `PHPUnit` output by adding this step after the `setup-php` step. This will scan the logs for failing tests and surface that information prominently in the GitHub Actions UI by creating annotations and log file decorations.
+Setup problem matchers for your `PHPUnit` output by adding this step after the `setup-php` step. This will scan the logs for failing tests and surface that information prominently in the GitHub Actions UI by creating annotations and log file decorations.
```yaml
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
```
-#### Other tools
+#### Other Tools
For tools that support `checkstyle` reporting like `phpstan`, `psalm`, `php-cs-fixer` and `phpcs` you can use `cs2pr` to annotate your code.
For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-pull-request-from-checkstyle).
@@ -299,7 +433,7 @@ For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-p
```yaml
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: cs2pr, phpstan
@@ -338,13 +472,13 @@ Examples for setting up this GitHub Action with different PHP Frameworks/Package
## :scroll: License
-The scripts and documentation in this project are released under the [MIT License](LICENSE "License for shivammathur/setup-php"). This project has multiple [dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Dependencies for this PHP Action") and uses [various works](#bookmark-this-action-uses-the-following-works "Tools used by this action"). Their licenses can be found in their respective repositories.
+The scripts and documentation in this project are released under the [MIT License](LICENSE "License for shivammathur/setup-php"). This project has multiple [dependencies](#dependencies "Dependencies for this PHP Action"). Their licenses can be found in their respective repositories.
## :+1: Contributions
Contributions are welcome! See [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/setup-php contribution guide"). If you face any issues while using this or want to suggest a feature/improvement, create an issue [here](https://github.com/shivammathur/setup-php/issues "Issues reported").
-## :sparkling_heart: Support this project
+## :sparkling_heart: Support This Project
If this action helped you.
@@ -353,12 +487,16 @@ If this action helped you.
- I maintain this in my free time, please support me with a [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon") subscription or a one time contribution using [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal").
- If you need any help using this, please contact me using [Codementor](https://www.codementor.io/shivammathur "Shivam Mathur Codementor")
-## :bookmark: This action uses the following works
+## :bookmark: Dependencies
-- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Pre-compiled ubuntu packages")
-- [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Pre-compiled nightly PHP builds")
+- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
+- [gplessis/dotdeb-php](https://github.com/gplessis/dotdeb-php "Packaging for end of life PHP versions")
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
+- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages")
+- [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions "GitHub action to help with caching PHP extensions")
- [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php "Tap for PHP builds for MacOS")
+- [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Nightly PHP package")
+- [shivammathur/php5-ubuntu](https://github.com/shivammathur/php5-ubuntu "Scripts to setup PHP5 versions")
## :bookmark_tabs: Further Reading
diff --git a/examples/bedrock.yml b/examples/bedrock.yml
index 4b8f25e8..9d79b781 100644
--- a/examples/bedrock.yml
+++ b/examples/bedrock.yml
@@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
- name: Get composer cache directory
diff --git a/examples/cakephp-mysql.yml b/examples/cakephp-mysql.yml
index 478d6ba3..4065d798 100644
--- a/examples/cakephp-mysql.yml
+++ b/examples/cakephp-mysql.yml
@@ -27,7 +27,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
# You can also use ext-apcu or ext-memcached instead of ext-redis
@@ -63,7 +63,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
@@ -90,7 +90,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
diff --git a/examples/cakephp-postgres.yml b/examples/cakephp-postgres.yml
index 22743e5b..21aeaa8a 100644
--- a/examples/cakephp-postgres.yml
+++ b/examples/cakephp-postgres.yml
@@ -27,7 +27,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
# You can also use ext-apcu or ext-memcached instead of ext-redis
@@ -63,7 +63,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
@@ -90,7 +90,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
diff --git a/examples/cakephp.yml b/examples/cakephp.yml
index 14a252cf..65e011b8 100644
--- a/examples/cakephp.yml
+++ b/examples/cakephp.yml
@@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, pdo_sqlite, pdo_mysql
@@ -43,7 +43,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
@@ -70,7 +70,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
- uses: shivammathur/setup-php@v1
+ uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl
diff --git a/examples/codeigniter.yml b/examples/codeigniter.yml
index 2c0c535d..3d3bb03d 100644
--- a/examples/codeigniter.yml
+++ b/examples/codeigniter.yml
@@ -12,7 +12,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, curl, dom
diff --git a/examples/laravel-mysql.yml b/examples/laravel-mysql.yml
index 5de24522..981e3a28 100644
--- a/examples/laravel-mysql.yml
+++ b/examples/laravel-mysql.yml
@@ -36,7 +36,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
diff --git a/examples/laravel-postgres.yml b/examples/laravel-postgres.yml
index 2107dfa8..e0b00391 100644
--- a/examples/laravel-postgres.yml
+++ b/examples/laravel-postgres.yml
@@ -38,7 +38,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, pgsql
diff --git a/examples/laravel.yml b/examples/laravel.yml
index d5b84465..68480c3f 100644
--- a/examples/laravel.yml
+++ b/examples/laravel.yml
@@ -14,7 +14,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo
diff --git a/examples/lumen-mysql.yml b/examples/lumen-mysql.yml
index d358e500..a3cf2572 100644
--- a/examples/lumen-mysql.yml
+++ b/examples/lumen-mysql.yml
@@ -36,7 +36,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
diff --git a/examples/lumen-postgres.yml b/examples/lumen-postgres.yml
index 9117c37f..609cecd5 100644
--- a/examples/lumen-postgres.yml
+++ b/examples/lumen-postgres.yml
@@ -38,7 +38,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, pgsql
diff --git a/examples/lumen.yml b/examples/lumen.yml
index 0b7ae9bc..6c3f7b17 100644
--- a/examples/lumen.yml
+++ b/examples/lumen.yml
@@ -14,7 +14,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
diff --git a/examples/phalcon-mysql.yml b/examples/phalcon-mysql.yml
index 9e4ffb18..e422d0db 100644
--- a/examples/phalcon-mysql.yml
+++ b/examples/phalcon-mysql.yml
@@ -36,7 +36,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, zip, phalcon4, mysql #use phalcon3 for the phalcon 3.x.
diff --git a/examples/phalcon-postgres.yml b/examples/phalcon-postgres.yml
index 68856472..321502d8 100644
--- a/examples/phalcon-postgres.yml
+++ b/examples/phalcon-postgres.yml
@@ -37,7 +37,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, zip, phalcon4, pgsql #use phalcon3 for the phalcon 3.x
diff --git a/examples/sage.yml b/examples/sage.yml
index 24326acc..3863b3a7 100644
--- a/examples/sage.yml
+++ b/examples/sage.yml
@@ -18,7 +18,7 @@ jobs:
with:
node-version: ${{ matrix.node-versions }}
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
diff --git a/examples/slim-framework.yml b/examples/slim-framework.yml
index bea31160..329ed8b0 100644
--- a/examples/slim-framework.yml
+++ b/examples/slim-framework.yml
@@ -12,7 +12,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, simplexml, dom
diff --git a/examples/symfony-mysql.yml b/examples/symfony-mysql.yml
index ecee71e1..98ff0fae 100644
--- a/examples/symfony-mysql.yml
+++ b/examples/symfony-mysql.yml
@@ -23,7 +23,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql
diff --git a/examples/symfony-postgres.yml b/examples/symfony-postgres.yml
index 8a0a40df..e3638ea2 100644
--- a/examples/symfony-postgres.yml
+++ b/examples/symfony-postgres.yml
@@ -23,7 +23,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql
diff --git a/examples/symfony.yml b/examples/symfony.yml
index f171e9b6..6c9a0d70 100644
--- a/examples/symfony.yml
+++ b/examples/symfony.yml
@@ -14,7 +14,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
diff --git a/examples/yii2-mysql.yml b/examples/yii2-mysql.yml
index 81e4b406..1f33bd63 100644
--- a/examples/yii2-mysql.yml
+++ b/examples/yii2-mysql.yml
@@ -33,7 +33,7 @@ jobs:
with:
node-version: 10.x
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, gd, imagick, zip, dom, mysql
diff --git a/examples/yii2-postgres.yml b/examples/yii2-postgres.yml
index 7301f3dc..b3465faf 100644
--- a/examples/yii2-postgres.yml
+++ b/examples/yii2-postgres.yml
@@ -33,7 +33,7 @@ jobs:
with:
node-version: 10.x
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, gd, imagick, zip, dom, pgsql
diff --git a/examples/zend-framework.yml b/examples/zend-framework.yml
index 150ee631..3a4921b6 100644
--- a/examples/zend-framework.yml
+++ b/examples/zend-framework.yml
@@ -12,7 +12,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
- uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
+ uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, bcmath, curl, intl
From d99c8732ba9d65f4da9982de57715e9ccd899f29 Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Fri, 14 Feb 2020 15:09:56 +0530
Subject: [PATCH 07/13] Fix extension_version on windows
---
dist/index.js | 8 +-------
src/extensions.ts | 8 +-------
src/scripts/win32.ps1 | 5 ++++-
3 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/dist/index.js b/dist/index.js
index 16ccc9d5..8aa9c986 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -2765,13 +2765,7 @@ function addExtensionWindows(extension_csv, version, pipe) {
break;
// match exact versions
case /.*-\d+\.\d+\.\d+/.test(version_extension):
- script +=
- '\nAdd-Extension ' +
- extension_name +
- ' ' +
- 'stable' +
- ' ' +
- stability;
+ script += '\nAdd-Extension ' + extension_name + ' stable ' + stability;
return;
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
diff --git a/src/extensions.ts b/src/extensions.ts
index a68f8406..a434b887 100644
--- a/src/extensions.ts
+++ b/src/extensions.ts
@@ -104,13 +104,7 @@ export async function addExtensionWindows(
break;
// match exact versions
case /.*-\d+\.\d+\.\d+/.test(version_extension):
- script +=
- '\nAdd-Extension ' +
- extension_name +
- ' ' +
- 'stable' +
- ' ' +
- stability;
+ script += '\nAdd-Extension ' + extension_name + ' stable ' + stability;
return;
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1
index f538c1be..20d5099b 100644
--- a/src/scripts/win32.ps1
+++ b/src/scripts/win32.ps1
@@ -55,7 +55,10 @@ Function Add-Extension {
}
}
else {
- Install-PhpExtension -Extension $extension -MinimumStability $mininum_stability -Version $extension_version -Path $php_dir
+ if($extension_version -ne '') {
+ $extension = "$extension -Version $extension_version"
+ }
+ Install-PhpExtension -Extension $extension -MinimumStability $mininum_stability -Path $php_dir
Add-Log $tick $extension "Installed and enabled"
}
}
From f9202d6b64341ab390d76fdbacb51aae0df9b70e Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Fri, 14 Feb 2020 16:29:43 +0530
Subject: [PATCH 08/13] Support existing PHP on darwin
---
src/scripts/darwin.sh | 49 +++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 25 deletions(-)
diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh
index 106a78b9..5355c5b2 100644
--- a/src/scripts/darwin.sh
+++ b/src/scripts/darwin.sh
@@ -180,41 +180,40 @@ port_setup_php() {
add_pecl_old "$1"
}
-# Function to setup PHP
-setup_php() {
- if [[ "$version" =~ $old_versions ]]; then
- step_log "Setup Macports"
- add_macports >/dev/null 2>&1
- add_log "$tick" "Macports" "Installed"
- sync_macports >/dev/null 2>&1
- add_log "$tick" "Macports" "Synced"
-
- step_log "Setup PHP"
- port_setup_php $nodot_version >/dev/null 2>&1
- else
- step_log "Setup PHP"
- export HOMEBREW_NO_INSTALL_CLEANUP=TRUE >/dev/null 2>&1
- brew tap shivammathur/homebrew-php >/dev/null 2>&1
- brew install shivammathur/php/php@"$version" >/dev/null 2>&1
- brew link --force --overwrite php@"$version" >/dev/null 2>&1
- fi
-}
-
# Variables
tick="✓"
cross="✗"
version=$1
nodot_version=${1/./}
old_versions="5.[3-5]"
+existing_version=$(php-config --version | cut -c 1-3)
-# Setup Environment
+# Setup PHP
+step_log "Setup PHP"
if [[ "$version" =~ $old_versions ]]; then
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
export TERM=xterm
+ step_log "Setup Macports"
+ add_macports >/dev/null 2>&1
+ add_log "$tick" "Macports" "Installed"
+ sync_macports >/dev/null 2>&1
+ add_log "$tick" "Macports" "Synced"
+ step_log "Setup PHP"
+ port_setup_php $nodot_version >/dev/null 2>&1
+ status="Installed"
+elif [ "$existing_version" != "$version" ] || [ "$update" = "true" ]; then
+ export HOMEBREW_NO_INSTALL_CLEANUP=TRUE >/dev/null 2>&1
+ brew tap shivammathur/homebrew-php >/dev/null 2>&1
+ brew install shivammathur/php/php@"$version" >/dev/null 2>&1
+ brew link --force --overwrite php@"$version" >/dev/null 2>&1
+ if [ "$update" = "true" ]; then
+ status="Updated to"
+ else
+ status="Installed"
+ fi
+else
+ status="Found"
fi
-
-# Setup PHP
-setup_php
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
sudo chmod 777 "$ini_file"
echo "date.timezone=UTC" >>"$ini_file"
@@ -222,4 +221,4 @@ ext_dir=$(php -i | grep -Ei "extension_dir => /(usr|opt)" | sed -e "s|.*=> s*||"
sudo mkdir -p "$ext_dir"
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
configure_pecl
-add_log "$tick" "PHP" "Installed PHP $semver"
\ No newline at end of file
+add_log "$tick" "PHP" "$status PHP $semver"
\ No newline at end of file
From 40944de1294db99bb46ec59899be21f0e7449172 Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Sat, 15 Feb 2020 22:51:02 +0530
Subject: [PATCH 09/13] Fix phalcon caching on darwin
---
dist/index.js | 7 +++---
src/extensions.ts | 7 +++---
src/scripts/ext/phalcon_darwin.sh | 42 +++++++++++++++++++++++++------
3 files changed, 40 insertions(+), 16 deletions(-)
diff --git a/dist/index.js b/dist/index.js
index 8aa9c986..cfe5cc02 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -2716,15 +2716,14 @@ function addExtensionDarwin(extension_csv, version, pipe) {
pipe;
break;
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
- install_command =
+ script +=
'sh ' +
path.join(__dirname, '../src/scripts/ext/phalcon_darwin.sh') +
' ' +
extension +
' ' +
- version +
- pipe;
- break;
+ version;
+ return;
default:
install_command = 'sudo pecl install -f ' + extension + pipe;
break;
diff --git a/src/extensions.ts b/src/extensions.ts
index a434b887..7507e9ac 100644
--- a/src/extensions.ts
+++ b/src/extensions.ts
@@ -55,15 +55,14 @@ export async function addExtensionDarwin(
pipe;
break;
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
- install_command =
+ script +=
'sh ' +
path.join(__dirname, '../src/scripts/ext/phalcon_darwin.sh') +
' ' +
extension +
' ' +
- version +
- pipe;
- break;
+ version;
+ return;
default:
install_command = 'sudo pecl install -f ' + extension + pipe;
break;
diff --git a/src/scripts/ext/phalcon_darwin.sh b/src/scripts/ext/phalcon_darwin.sh
index 8869c304..0297eed2 100644
--- a/src/scripts/ext/phalcon_darwin.sh
+++ b/src/scripts/ext/phalcon_darwin.sh
@@ -1,17 +1,43 @@
+# Function to log result of a operation
+add_log() {
+ mark=$1
+ subject=$2
+ message=$3
+ if [ "$mark" = "$tick" ]; then
+ printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
+ else
+ printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
+ fi
+}
+
+# Function to install phalcon
+install_phalcon() {
+ (
+ brew tap shivammathur/homebrew-phalcon >/dev/null 2>&1
+ brew install phalcon@"$php_version"_"$extension_major" >/dev/null 2>&1
+ sudo cp /usr/local/opt/psr@"$php_version"/psr.so "$ext_dir" >/dev/null 2>&1
+ sudo cp /usr/local/opt/phalcon@"$php_version"_"$extension_major"/phalcon.so "$ext_dir" >/dev/null 2>&1
+ add_log "$tick" "$extension" "Installed and enabled"
+ ) || add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
+}
+
+tick="✓"
+cross="✗"
extension=$1
extension_major=${extension: -1}
php_version=$2
+semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
if [ -e "$ext_dir/psr.so" ] && [ -e "$ext_dir/phalcon.so" ]; then
- echo "extension=psr" >>"$ini_file"
- echo "extension=phalcon" >>"$ini_file"
- phalcon_version=$(php -d="extension=phalcon" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
+ phalcon_version=$(php -d="extension=psr.so" -d="extension=phalcon.so" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
if [ "$phalcon_version" != "$extension_major" ]; then
- brew tap shivammathur/homebrew-phalcon
- brew install phalcon@"$php_version"_"$extension_major"
+ install_phalcon
+ else
+ echo "extension=psr.so" >>"$ini_file"
+ echo "extension=phalcon.so" >>"$ini_file"
+ add_log "$tick" "$extension" "Enabled"
fi
else
- brew tap shivammathur/homebrew-phalcon
- brew install phalcon@"$php_version"_"$extension_major"
-fi
\ No newline at end of file
+ install_phalcon
+fi
From 3a473c9a228ed4286d3d5c54a4856067409244e9 Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Sun, 16 Feb 2020 00:25:50 +0530
Subject: [PATCH 10/13] Add support for unstable versions
---
__tests__/extensions.test.ts | 3 ++-
dist/index.js | 34 +++++++++++++++++++-------------
src/extensions.ts | 38 +++++++++++++++++++++++-------------
src/scripts/darwin.sh | 1 +
src/scripts/linux.sh | 2 ++
src/scripts/win32.ps1 | 6 ++++--
6 files changed, 53 insertions(+), 31 deletions(-)
diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts
index 98823f39..3ef06a23 100644
--- a/__tests__/extensions.test.ts
+++ b/__tests__/extensions.test.ts
@@ -3,7 +3,7 @@ import * as extensions from '../src/extensions';
describe('Extension tests', () => {
it('checking addExtensionOnWindows', async () => {
let win32: string = await extensions.addExtension(
- 'xdebug, pcov, phalcon4, ast-beta, grpc-1.2.3',
+ 'xdebug, pcov, phalcon4, ast-beta, grpc-1.2.3, inotify-1.2.3alpha2',
'7.4',
'win32'
);
@@ -12,6 +12,7 @@ describe('Extension tests', () => {
expect(win32).toContain('phalcon.ps1 phalcon4');
expect(win32).toContain('Add-Extension ast beta');
expect(win32).toContain('Add-Extension grpc stable 1.2.3');
+ expect(win32).toContain('Add-Extension inotify alpha 1.2.3');
win32 = await extensions.addExtension(
'phalcon3, does_not_exist',
diff --git a/dist/index.js b/dist/index.js
index cfe5cc02..f7471eb0 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -2679,17 +2679,17 @@ function addExtensionDarwin(extension_csv, version, pipe) {
return __awaiter(this, void 0, void 0, function* () {
extension = extension.toLowerCase();
const version_extension = version + extension;
- const [extension_name, stability] = extension.split('-');
- const prefix = yield utils.getExtensionPrefix(extension_name);
+ const [ext_name, ext_version] = extension.split('-');
+ const prefix = yield utils.getExtensionPrefix(ext_name);
let install_command = '';
switch (true) {
// match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension):
script +=
'\nadd_unstable_extension ' +
- extension_name +
+ ext_name +
' ' +
- stability +
+ ext_version +
' ' +
prefix;
return;
@@ -2755,16 +2755,22 @@ function addExtensionWindows(extension_csv, version, pipe) {
yield utils.asyncForEach(extensions, function (extension) {
return __awaiter(this, void 0, void 0, function* () {
extension = extension.toLowerCase();
- const [extension_name, stability] = extension.split('-');
+ const [ext_name, ext_version] = extension.split('-');
const version_extension = version + extension;
+ let matches;
switch (true) {
// match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension):
- script += '\nAdd-Extension ' + extension_name + ' ' + stability;
+ script += '\nAdd-Extension ' + ext_name + ' ' + ext_version;
break;
// match exact versions
- case /.*-\d+\.\d+\.\d+/.test(version_extension):
- script += '\nAdd-Extension ' + extension_name + ' stable ' + stability;
+ case /.*-\d+\.\d+\.\d+$/.test(version_extension):
+ script += '\nAdd-Extension ' + ext_name + ' stable ' + ext_version;
+ return;
+ case /.*-(\d+\.\d+\.\d)+(beta|alpha|devel|snapshot)\d*/.test(version_extension):
+ matches = /.*-(\d+\.\d+\.\d)+(beta|alpha|devel|snapshot)\d*/.exec(version_extension);
+ script +=
+ '\nAdd-Extension ' + ext_name + ' ' + matches[2] + ' ' + matches[1];
return;
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
@@ -2802,23 +2808,23 @@ function addExtensionLinux(extension_csv, version, pipe) {
return __awaiter(this, void 0, void 0, function* () {
extension = extension.toLowerCase();
const version_extension = version + extension;
- const [extension_name, stability] = extension.split('-');
- const prefix = yield utils.getExtensionPrefix(extension_name);
+ const [ext_name, ext_version] = extension.split('-');
+ const prefix = yield utils.getExtensionPrefix(ext_name);
let install_command = '';
switch (true) {
// match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension):
script +=
'\nadd_unstable_extension ' +
- extension_name +
+ ext_name +
' ' +
- stability +
+ ext_version +
' ' +
prefix;
return;
// match exact versions
- case /.*-\d+\.\d+\.\d+/.test(version_extension):
- script += '\nadd_pecl_extension ' + extension_name + ' ' + stability;
+ case /.*-\d+\.\d+\.\d+.*/.test(version_extension):
+ script += '\nadd_pecl_extension ' + ext_name + ' ' + ext_version;
return;
// match 5.6gearman..7.4gearman
case /^((5\.6)|(7\.[0-4]))gearman$/.test(version_extension):
diff --git a/src/extensions.ts b/src/extensions.ts
index 7507e9ac..62f68d13 100644
--- a/src/extensions.ts
+++ b/src/extensions.ts
@@ -18,17 +18,17 @@ export async function addExtensionDarwin(
await utils.asyncForEach(extensions, async function(extension: string) {
extension = extension.toLowerCase();
const version_extension: string = version + extension;
- const [extension_name, stability]: string[] = extension.split('-');
- const prefix = await utils.getExtensionPrefix(extension_name);
+ const [ext_name, ext_version]: string[] = extension.split('-');
+ const prefix = await utils.getExtensionPrefix(ext_name);
let install_command = '';
switch (true) {
// match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension):
script +=
'\nadd_unstable_extension ' +
- extension_name +
+ ext_name +
' ' +
- stability +
+ ext_version +
' ' +
prefix;
return;
@@ -94,16 +94,26 @@ export async function addExtensionWindows(
let script = '\n';
await utils.asyncForEach(extensions, async function(extension: string) {
extension = extension.toLowerCase();
- const [extension_name, stability]: string[] = extension.split('-');
+ const [ext_name, ext_version]: string[] = extension.split('-');
const version_extension: string = version + extension;
+ let matches: RegExpExecArray;
switch (true) {
// match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension):
- script += '\nAdd-Extension ' + extension_name + ' ' + stability;
+ script += '\nAdd-Extension ' + ext_name + ' ' + ext_version;
break;
// match exact versions
- case /.*-\d+\.\d+\.\d+/.test(version_extension):
- script += '\nAdd-Extension ' + extension_name + ' stable ' + stability;
+ case /.*-\d+\.\d+\.\d+$/.test(version_extension):
+ script += '\nAdd-Extension ' + ext_name + ' stable ' + ext_version;
+ return;
+ case /.*-(\d+\.\d+\.\d)+(beta|alpha|devel|snapshot)\d*/.test(
+ version_extension
+ ):
+ matches = /.*-(\d+\.\d+\.\d)+(beta|alpha|devel|snapshot)\d*/.exec(
+ version_extension
+ ) as RegExpExecArray;
+ script +=
+ '\nAdd-Extension ' + ext_name + ' ' + matches[2] + ' ' + matches[1];
return;
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
@@ -141,23 +151,23 @@ export async function addExtensionLinux(
await utils.asyncForEach(extensions, async function(extension: string) {
extension = extension.toLowerCase();
const version_extension: string = version + extension;
- const [extension_name, stability]: string[] = extension.split('-');
- const prefix = await utils.getExtensionPrefix(extension_name);
+ const [ext_name, ext_version]: string[] = extension.split('-');
+ const prefix = await utils.getExtensionPrefix(ext_name);
let install_command = '';
switch (true) {
// match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension):
script +=
'\nadd_unstable_extension ' +
- extension_name +
+ ext_name +
' ' +
- stability +
+ ext_version +
' ' +
prefix;
return;
// match exact versions
- case /.*-\d+\.\d+\.\d+/.test(version_extension):
- script += '\nadd_pecl_extension ' + extension_name + ' ' + stability;
+ case /.*-\d+\.\d+\.\d+.*/.test(version_extension):
+ script += '\nadd_pecl_extension ' + ext_name + ' ' + ext_version;
return;
// match 5.6gearman..7.4gearman
case /^((5\.6)|(7\.[0-4]))gearman$/.test(version_extension):
diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh
index 5355c5b2..ca5a2ca8 100644
--- a/src/scripts/darwin.sh
+++ b/src/scripts/darwin.sh
@@ -187,6 +187,7 @@ version=$1
nodot_version=${1/./}
old_versions="5.[3-5]"
existing_version=$(php-config --version | cut -c 1-3)
+[[ -z "${update}" ]] && update='false' || update="${update}"
# Setup PHP
step_log "Setup PHP"
diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh
index 381b7937..aa9400f9 100644
--- a/src/scripts/linux.sh
+++ b/src/scripts/linux.sh
@@ -98,6 +98,7 @@ remove_extension() {
add_pecl_extension() {
extension=$1
pecl_version=$2
+ delete_extension "$extension"
(sudo pecl install -f "$extension-$pecl_version" >/dev/null 2>&1 &&
add_log "$tick" "$extension" "Installed and enabled") ||
add_log "$cross" "$extension" "Could not install $extension-$pecl_version on PHP $semver"
@@ -251,6 +252,7 @@ old_versions="5.[4-5]"
debconf_fix="DEBIAN_FRONTEND=noninteractive"
apt_install="sudo $debconf_fix apt-fast install -y"
existing_version=$(php-config --version | cut -c 1-3)
+[[ -z "${update}" ]] && update='false' || update="${update}"
# Setup PHP
step_log "Setup PHP"
diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1
index 20d5099b..6f990a6b 100644
--- a/src/scripts/win32.ps1
+++ b/src/scripts/win32.ps1
@@ -56,9 +56,11 @@ Function Add-Extension {
}
else {
if($extension_version -ne '') {
- $extension = "$extension -Version $extension_version"
+ Install-PhpExtension -Extension $extension -Version $extension_version -MinimumStability $mininum_stability -Path $php_dir
+ } else {
+ Install-PhpExtension -Extension $extension -MinimumStability $mininum_stability -Path $php_dir
}
- Install-PhpExtension -Extension $extension -MinimumStability $mininum_stability -Path $php_dir
+
Add-Log $tick $extension "Installed and enabled"
}
}
From 96d5358317aaa88faed39025f8d9c925fbb08ced Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Sun, 16 Feb 2020 18:02:43 +0530
Subject: [PATCH 11/13] Bump version to 2.0.0
---
package-lock.json | 167 ++++++++++++++++++++++------------------------
package.json | 16 ++---
2 files changed, 88 insertions(+), 95 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index d8710f6b..23b022ad 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "setup-php",
- "version": "1.8.2",
+ "version": "2.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -284,9 +284,9 @@
"dev": true
},
"@cnakazawa/watch": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz",
- "integrity": "sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz",
+ "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==",
"dev": true,
"requires": {
"exec-sh": "^0.3.2",
@@ -425,9 +425,9 @@
},
"dependencies": {
"rimraf": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.1.tgz",
- "integrity": "sha512-IQ4ikL8SjBiEDZfk+DFVwqRK8md24RWMEJkdSlgNLkyyAImcjf8SWvU1qFMDOb4igBClbTQ/ugPqXcRwdFTxZw==",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"dev": true,
"requires": {
"glob": "^7.1.3"
@@ -584,9 +584,9 @@
}
},
"@types/babel__core": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.3.tgz",
- "integrity": "sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA==",
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.4.tgz",
+ "integrity": "sha512-c/5MuRz5HM4aizqL5ViYfW4iEnmfPcfbH4Xa6GgLT21dMc1NGeNnuS6egHheOmP+kCJ9CAzC4pv4SDCWTnRkbg==",
"dev": true,
"requires": {
"@babel/parser": "^7.1.0",
@@ -662,9 +662,9 @@
}
},
"@types/jest": {
- "version": "25.1.1",
- "resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.1.1.tgz",
- "integrity": "sha512-bKSZJYZJLzwaoVYNN4W3A0RvKNYsrLm5tsuXaMlfYDxKf4gY2sFrMYneCugNQWGg1gjPW+FHBwNrwPzEi4sIsw==",
+ "version": "25.1.2",
+ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.1.2.tgz",
+ "integrity": "sha512-EsPIgEsonlXmYV7GzUqcvORsSS9Gqxw/OvkGwHfAdpjduNRxMlhsav0O5Kb0zijc/eXSO/uW6SJt9nwull8AUQ==",
"dev": true,
"requires": {
"jest-diff": "^25.1.0",
@@ -678,9 +678,9 @@
"dev": true
},
"@types/node": {
- "version": "13.7.0",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.0.tgz",
- "integrity": "sha512-GnZbirvmqZUzMgkFn70c74OQpTTUcCzlhQliTzYjQMqg+hVKcDnxdL19Ne3UdYzdMA/+W3eb646FWn/ZaT1NfQ==",
+ "version": "13.7.1",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.1.tgz",
+ "integrity": "sha512-Zq8gcQGmn4txQEJeiXo/KiLpon8TzAl0kmKH4zdWctPj05nWwp1ClMdAVEloqrQKfaC48PNLdgN/aVaLqUrluA==",
"dev": true
},
"@types/parse-json": {
@@ -711,12 +711,12 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.0.tgz",
- "integrity": "sha512-u7IcQ9qwsB6U806LupZmINRnQjC+RJyv36sV/ugaFWMHTbFm/hlLTRx3gGYJgHisxcGSTnf+I/fPDieRMhPSQQ==",
+ "version": "2.19.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.2.tgz",
+ "integrity": "sha512-HX2qOq2GOV04HNrmKnTpSIpHjfl7iwdXe3u/Nvt+/cpmdvzYvY0NHSiTkYN257jHnq4OM/yo+OsFgati+7LqJA==",
"dev": true,
"requires": {
- "@typescript-eslint/experimental-utils": "2.19.0",
+ "@typescript-eslint/experimental-utils": "2.19.2",
"eslint-utils": "^1.4.3",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0",
@@ -724,32 +724,32 @@
}
},
"@typescript-eslint/experimental-utils": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.0.tgz",
- "integrity": "sha512-zwpg6zEOPbhB3+GaQfufzlMUOO6GXCNZq6skk+b2ZkZAIoBhVoanWK255BS1g5x9bMwHpLhX0Rpn5Fc3NdCZdg==",
+ "version": "2.19.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.2.tgz",
+ "integrity": "sha512-B88QuwT1wMJR750YvTJBNjMZwmiPpbmKYLm1yI7PCc3x0NariqPwqaPsoJRwU9DmUi0cd9dkhz1IqEnwfD+P1A==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
- "@typescript-eslint/typescript-estree": "2.19.0",
+ "@typescript-eslint/typescript-estree": "2.19.2",
"eslint-scope": "^5.0.0"
}
},
"@typescript-eslint/parser": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.19.0.tgz",
- "integrity": "sha512-s0jZoxAWjHnuidbbN7aA+BFVXn4TCcxEVGPV8lWMxZglSs3NRnFFAlL+aIENNmzB2/1jUJuySi6GiM6uACPmpg==",
+ "version": "2.19.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.19.2.tgz",
+ "integrity": "sha512-8uwnYGKqX9wWHGPGdLB9sk9+12sjcdqEEYKGgbS8A0IvYX59h01o8os5qXUHMq2na8vpDRaV0suTLM7S8wraTA==",
"dev": true,
"requires": {
"@types/eslint-visitor-keys": "^1.0.0",
- "@typescript-eslint/experimental-utils": "2.19.0",
- "@typescript-eslint/typescript-estree": "2.19.0",
+ "@typescript-eslint/experimental-utils": "2.19.2",
+ "@typescript-eslint/typescript-estree": "2.19.2",
"eslint-visitor-keys": "^1.1.0"
}
},
"@typescript-eslint/typescript-estree": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.0.tgz",
- "integrity": "sha512-n6/Xa37k0jQdwpUszffi19AlNbVCR0sdvCs3DmSKMD7wBttKY31lhD2fug5kMD91B2qW4mQldaTEc1PEzvGu8w==",
+ "version": "2.19.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.2.tgz",
+ "integrity": "sha512-Xu/qa0MDk6upQWqE4Qy2X16Xg8Vi32tQS2PR0AvnT/ZYS4YGDvtn2MStOh5y8Zy2mg4NuL06KUHlvCh95j9C6Q==",
"dev": true,
"requires": {
"debug": "^4.1.1",
@@ -762,9 +762,9 @@
}
},
"@zeit/ncc": {
- "version": "0.21.0",
- "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.21.0.tgz",
- "integrity": "sha512-RUMdvVK/w78oo+yBjruZltt0kJXYar2un/1bYQ2LuHG7GmFVm+QjxzEmySwREctaJdEnBvlMdUNWd9hXHxEI3g==",
+ "version": "0.21.1",
+ "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.21.1.tgz",
+ "integrity": "sha512-M9WzgquSOt2nsjRkYM9LRylBLmmlwNCwYbm3Up3PDEshfvdmIfqpFNSK8EJvR18NwZjGHE5z2avlDtYQx2JQnw==",
"dev": true
},
"abab": {
@@ -1324,9 +1324,9 @@
}
},
"compare-versions": {
- "version": "3.5.1",
- "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.5.1.tgz",
- "integrity": "sha512-9fGPIB7C6AyM18CJJBHt5EnCZDG3oiTJYy0NjfIAGjKpzv0tkxWko7TNQHF5ymqm7IH03tqmeuBxtvD+Izh6mg==",
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz",
+ "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==",
"dev": true
},
"component-emitter": {
@@ -1649,9 +1649,9 @@
"dev": true
},
"escodegen": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.13.0.tgz",
- "integrity": "sha512-eYk2dCkxR07DsHA/X2hRBj0CFAZeri/LyDMc0C8JT1Hqi6JnVpMhJ7XFITbb0+yZS3lVkaPL2oCkZ3AVmeVbMw==",
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz",
+ "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==",
"dev": true,
"requires": {
"esprima": "^4.0.1",
@@ -1875,13 +1875,12 @@
}
},
"eslint-plugin-jest": {
- "version": "23.6.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.6.0.tgz",
- "integrity": "sha512-GH8AhcFXspOLqak7fqnddLXEJsrFyvgO8Bm60SexvKSn1+3rWYESnCiWUOCUcBTprNSDSE4CtAZdM4EyV6gPPw==",
+ "version": "23.7.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.7.0.tgz",
+ "integrity": "sha512-zkiyGlvJeHNjAEz8FaIxTXNblJJ/zj3waNbYbgflK7K6uy0cpE5zJBt/JpJtOBGM/UGkC6BqsQ4n0y7kQ2HA8w==",
"dev": true,
"requires": {
- "@typescript-eslint/experimental-utils": "^2.5.0",
- "micromatch": "^4.0.2"
+ "@typescript-eslint/experimental-utils": "^2.5.0"
}
},
"eslint-plugin-prettier": {
@@ -1936,9 +1935,9 @@
"dev": true
},
"esquery": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz",
- "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==",
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.1.0.tgz",
+ "integrity": "sha512-MxYW9xKmROWF672KqjO75sszsA8Mxhw06YFeS5VHlB98KDHbOSurm3ArsjO60Eaf3QmGMCP1yn+0JQkNLo/97Q==",
"dev": true,
"requires": {
"estraverse": "^4.0.0"
@@ -2537,9 +2536,9 @@
"dev": true
},
"husky": {
- "version": "4.2.1",
- "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.1.tgz",
- "integrity": "sha512-Qa0lRreeIf4Tl92sSs42ER6qc3hzoyQPPorzOrFWfPEVbdi6LuvJEqWKPk905fOWIR76iBpp7ECZNIwk+a8xuQ==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.3.tgz",
+ "integrity": "sha512-VxTsSTRwYveKXN4SaH1/FefRJYCtx+wx04sSVcOpD7N2zjoHxa+cEJ07Qg5NmV3HAK+IRKOyNVpi2YBIVccIfQ==",
"dev": true,
"requires": {
"chalk": "^3.0.0",
@@ -3557,9 +3556,9 @@
},
"dependencies": {
"semver": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.2.tgz",
- "integrity": "sha512-BJs9T/H8sEVHbeigqzIEo57Iu/3DG6c4QoqTfbQB3BPA4zgzAomh/Fk9E7QtjWQ8mx2dgA9YCfSF4y9k9bHNpQ==",
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.3.tgz",
+ "integrity": "sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA==",
"dev": true
}
}
@@ -3819,9 +3818,9 @@
}
},
"make-dir": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz",
- "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz",
+ "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==",
"dev": true,
"requires": {
"semver": "^6.0.0"
@@ -4390,13 +4389,13 @@
"dev": true
},
"prompts": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.0.tgz",
- "integrity": "sha512-NfbbPPg/74fT7wk2XYQ7hAIp9zJyZp5Fu19iRbORqqy1BhtrkZ0fPafBU+7bmn8ie69DpT0R6QpJIN2oisYjJg==",
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.1.tgz",
+ "integrity": "sha512-qIP2lQyCwYbdzcqHIUi2HAxiWixhoM9OdLCWf8txXsapC/X9YdsCoeyRIXE/GP+Q0J37Q7+XN/MFqbUa7IzXNA==",
"dev": true,
"requires": {
"kleur": "^3.0.3",
- "sisteransi": "^1.0.3"
+ "sisteransi": "^1.0.4"
}
},
"psl": {
@@ -4504,9 +4503,9 @@
"dev": true
},
"request": {
- "version": "2.88.0",
- "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
- "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
+ "version": "2.88.2",
+ "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
+ "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
"dev": true,
"requires": {
"aws-sign2": "~0.7.0",
@@ -4516,7 +4515,7 @@
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
- "har-validator": "~5.1.0",
+ "har-validator": "~5.1.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
@@ -4526,25 +4525,19 @@
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
- "tough-cookie": "~2.4.3",
+ "tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
},
"dependencies": {
- "punycode": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
- "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
- "dev": true
- },
"tough-cookie": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
- "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
+ "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
"dev": true,
"requires": {
- "psl": "^1.1.24",
- "punycode": "^1.4.1"
+ "psl": "^1.1.28",
+ "punycode": "^2.1.1"
}
}
}
@@ -4594,9 +4587,9 @@
"dev": true
},
"resolve": {
- "version": "1.15.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz",
- "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==",
+ "version": "1.15.1",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz",
+ "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==",
"dev": true,
"requires": {
"path-parse": "^1.0.6"
@@ -5350,9 +5343,9 @@
}
},
"supports-hyperlinks": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.0.0.tgz",
- "integrity": "sha512-bFhn0MQ8qefLyJ3K7PpHiPUTuTVPWw6RXfaMeV6xgJLXtBbszyboz1bvGTVv4R0YpQm2DqlXXn0fFHhxUHVE5w==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz",
+ "integrity": "sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA==",
"dev": true,
"requires": {
"has-flag": "^4.0.0",
@@ -5728,9 +5721,9 @@
"dev": true
},
"v8-to-istanbul": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-4.0.1.tgz",
- "integrity": "sha512-x0yZvZAkjJwdD3fPiJzYP37aod0ati4LlmD2RmpKjqewjKAov/u/ytZ8ViIZb07cN4cePKzl9ijiUi7C1LQ8hQ==",
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-4.1.2.tgz",
+ "integrity": "sha512-G9R+Hpw0ITAmPSr47lSlc5A1uekSYzXxTMlFxso2xoffwo4jQnzbv1p9yXIinO8UMZKfAFewaCHwWvnH4Jb4Ug==",
"dev": true,
"requires": {
"@types/istanbul-lib-coverage": "^2.0.1",
diff --git a/package.json b/package.json
index 8bdd36c0..2b98dbb6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "setup-php",
- "version": "1.8.2",
+ "version": "2.0.0",
"private": false,
"description": "Setup PHP for use with GitHub Actions",
"main": "dist/index.js",
@@ -30,17 +30,17 @@
"fs": "0.0.1-security"
},
"devDependencies": {
- "@types/jest": "^25.1.1",
- "@types/node": "^13.7.0",
- "@typescript-eslint/eslint-plugin": "^2.19.0",
- "@typescript-eslint/parser": "^2.19.0",
- "@zeit/ncc": "^0.21.0",
+ "@types/jest": "^25.1.2",
+ "@types/node": "^13.7.1",
+ "@typescript-eslint/eslint-plugin": "^2.19.2",
+ "@typescript-eslint/parser": "^2.19.2",
+ "@zeit/ncc": "^0.21.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
- "eslint-plugin-jest": "^23.6.0",
+ "eslint-plugin-jest": "^23.7.0",
"eslint-plugin-prettier": "^3.1.2",
- "husky": "^4.2.1",
+ "husky": "^4.2.3",
"jest": "^25.1.0",
"jest-circus": "^25.1.0",
"prettier": "^1.19.1",
From e644692ccf1c13e4efceb15c52517c474a4ae4f8 Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Sun, 16 Feb 2020 18:40:22 +0530
Subject: [PATCH 12/13] Update test workflow
---
.github/workflows/experimental-workflow.yml | 22 +++++++++++++++++--
.github/workflows/workflow.yml | 24 ++++++++++++++++++---
2 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/experimental-workflow.yml b/.github/workflows/experimental-workflow.yml
index e1816394..62c5cc5f 100644
--- a/.github/workflows/experimental-workflow.yml
+++ b/.github/workflows/experimental-workflow.yml
@@ -27,6 +27,9 @@ jobs:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['8.0']
+ env:
+ extensions: xml, opcache, xdebug, pcov
+ key: cache-v1
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -53,12 +56,27 @@ jobs:
timeout-minutes: 1
run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }}
+ - name: Setup cache environment
+ id: cache-env
+ uses: shivammathur/cache-extensions@v1
+ with:
+ php-version: ${{ matrix.php-versions }}
+ extensions: ${{ env.extensions }}
+ key: ${{ env.key }}
+
+ - name: Cache extensions
+ uses: actions/cache@v1
+ with:
+ path: ${{ steps.cache-env.outputs.dir }}
+ key: ${{ steps.cache-env.outputs.key }}
+ restore-keys: ${{ steps.cache-env.outputs.key }}
+
- name: Setup PHP with extensions and custom config
run: node dist/index.js
env:
php-version: ${{ matrix.php-versions }}
- extensions: xml, opcache, xdebug, pcov #optional
- ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata #optional
+ extensions: ${{ env.extensions }}
+ ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata
coverage: pcov
- name: Testing PHP version
diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
index 35927cc6..b9a5ee79 100644
--- a/.github/workflows/workflow.yml
+++ b/.github/workflows/workflow.yml
@@ -24,7 +24,10 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
- php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
+ php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
+ env:
+ extensions: xml, opcache, xdebug, pcov
+ key: cache-v1
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -51,12 +54,27 @@ jobs:
timeout-minutes: 1
run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }}
+ - name: Setup cache environment
+ id: cache-env
+ uses: shivammathur/cache-extensions@v1
+ with:
+ php-version: ${{ matrix.php-versions }}
+ extensions: ${{ env.extensions }}
+ key: ${{ env.key }}
+
+ - name: Cache extensions
+ uses: actions/cache@v1
+ with:
+ path: ${{ steps.cache-env.outputs.dir }}
+ key: ${{ steps.cache-env.outputs.key }}
+ restore-keys: ${{ steps.cache-env.outputs.key }}
+
- name: Setup PHP with extensions and custom config
run: node dist/index.js
env:
php-version: ${{ matrix.php-versions }}
- extensions: xml, opcache, xdebug, pcov #optional
- ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata #optional
+ extensions: ${{ env.extensions }}
+ ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata
- name: Testing PHP version
run: |
From cc55dbcaa8be0c795b2aa79c7414eadda62fcee6 Mon Sep 17 00:00:00 2001
From: Shivam Mathur
Date: Mon, 17 Feb 2020 02:35:18 +0530
Subject: [PATCH 13/13] Remove support for deprecated inputs
---
action.yml | 13 --
builds | 607 -------------------------------------------------
dist/index.js | 6 +-
src/install.ts | 7 +-
4 files changed, 4 insertions(+), 629 deletions(-)
delete mode 100644 builds
diff --git a/action.yml b/action.yml
index 65ea57cd..e9511e58 100644
--- a/action.yml
+++ b/action.yml
@@ -23,19 +23,6 @@ inputs:
update:
description: 'Update PHP if already installed.'
required: false
- # Deprecated options, do not use. Will not be supported in v2 which will be released around February 1, 2020.
- extension-csv:
- description: 'Deprecated! Use extensions instead.'
- deprecationMessage: 'The extension-csv property will not be supported in v2. Use extensions instead.'
- required: false
- ini-values-csv:
- description: 'Deprecated! Use ini-values instead.'
- deprecationMessage: 'The ini-values-csv property will not be supported in v2. Use ini-values instead.'
- required: false
- pecl:
- description: 'Deprecated! Use tools instead to setup PECL.'
- deprecationMessage: 'The pecl property will not be supported in v2. Specify pecl in tools instead.'
- required: false
runs:
using: 'node12'
main: 'dist/index.js'
diff --git a/builds b/builds
deleted file mode 100644
index 00771115..00000000
--- a/builds
+++ /dev/null
@@ -1,607 +0,0 @@
-
-
-
-
-
- Codeception Builds
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-