diff --git a/src/scripts/extensions/zephir_parser.ps1 b/src/scripts/extensions/zephir_parser.ps1 index 53ac22da..9e6f851d 100644 --- a/src/scripts/extensions/zephir_parser.ps1 +++ b/src/scripts/extensions/zephir_parser.ps1 @@ -71,10 +71,14 @@ Function Add-ZephirParser() { Enable-PhpExtension -Extension zephir_parser -Path $php_dir } else { $status = 'Installed and enabled' - Add-ZephirParserFromGitHub $extension + try { + Add-ZephirParserFromGitHub $extension + } catch { + Add-Extension $extension >$null 2>&1 + } } Add-ExtensionLog zephir_parser $status } catch { Add-Log $cross $extension "Could not install $extension on PHP $($installed.FullVersion)" } -} +} \ No newline at end of file diff --git a/src/scripts/extensions/zephir_parser.sh b/src/scripts/extensions/zephir_parser.sh index f1c9b5d3..af8887d1 100644 --- a/src/scripts/extensions/zephir_parser.sh +++ b/src/scripts/extensions/zephir_parser.sh @@ -17,9 +17,13 @@ add_zephir_parser_helper() { [ "$(uname -s)" = "Linux" ] && os_suffix=ubuntu || os_suffix=macos build_name=$(get -s -n "" https://api.github.com/repos/"$repo"/releases/tags/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1) [ -z "$build_name" ] && build_name=$(get -s -n "" "$zp_releases"/expanded_assets/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1) - get -q -e "/tmp/zp.zip" "$zp_releases"/download/"$ext_version"/"$build_name" - sudo unzip -o "/tmp/zp.zip" -d "${ext_dir:?}" - enable_extension zephir_parser extension + if [ -n "$build_name" ]; then + get -q -e "/tmp/zp.zip" "$zp_releases"/download/"$ext_version"/"$build_name" + sudo unzip -o "/tmp/zp.zip" -d "${ext_dir:?}" + enable_extension zephir_parser extension + else + pecl_install zephir_parser + fi } # Add zephir_parser