mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-05-09 02:07:33 +07:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7729e411ec | ||
|
|
af2322b95c |
@@ -1,9 +1,9 @@
|
|||||||
# Helper function to add gearman extension.
|
# Helper function to add gearman extension.
|
||||||
add_gearman_helper() {
|
add_gearman_helper() {
|
||||||
install_packages libgearman-dev
|
|
||||||
enable_extension gearman extension
|
enable_extension gearman extension
|
||||||
if ! check_extension gearman; then
|
if ! check_extension gearman; then
|
||||||
status="Installed and enabled"
|
status="Installed and enabled"
|
||||||
|
install_packages libgearman-dev
|
||||||
if [[ "${version:?}" =~ 5.[3-6] ]]; then
|
if [[ "${version:?}" =~ 5.[3-6] ]]; then
|
||||||
pecl_install gearman-1.1.2
|
pecl_install gearman-1.1.2
|
||||||
elif [[ "${version:?}" =~ 7.0 ]]; then
|
elif [[ "${version:?}" =~ 7.0 ]]; then
|
||||||
|
|||||||
@@ -203,16 +203,20 @@ Function Install-PSPackage() {
|
|||||||
$cmdlet
|
$cmdlet
|
||||||
)
|
)
|
||||||
$module_path = "$bin_dir\$psm1_path.psm1"
|
$module_path = "$bin_dir\$psm1_path.psm1"
|
||||||
|
$imported = $false
|
||||||
|
try {
|
||||||
if(-not (Test-Path $module_path -PathType Leaf)) {
|
if(-not (Test-Path $module_path -PathType Leaf)) {
|
||||||
$zip_file = "$bin_dir\$package.zip"
|
$zip_file = "$bin_dir\$package.zip"
|
||||||
Get-File -Url $url -OutFile $zip_file
|
Get-File -Url $url -OutFile $zip_file
|
||||||
Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force
|
Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force -ErrorAction Stop
|
||||||
}
|
}
|
||||||
Import-Module $module_path
|
Import-Module $module_path -ErrorAction Stop
|
||||||
if($null -eq (Get-Command $cmdlet -ErrorAction SilentlyContinue)) {
|
$imported = $null -ne (Get-Command $cmdlet -ErrorAction SilentlyContinue)
|
||||||
Install-Module -Name $package -Force
|
} catch { }
|
||||||
} else {
|
if($imported) {
|
||||||
Add-ToProfile $current_profile "$package-search" "Import-Module $module_path"
|
Add-ToProfile $current_profile "$package-search" "Import-Module $module_path"
|
||||||
|
} else {
|
||||||
|
Install-Module -Name $package -Force
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user