Skip to content

Commit

Permalink
Fix support for zephir_parser
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Dec 28, 2024
1 parent 5bb2eed commit 85ed51c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/scripts/extensions/zephir_parser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
}
}
10 changes: 7 additions & 3 deletions src/scripts/extensions/zephir_parser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85ed51c

Please sign in to comment.