mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Use blackfire API to get versions
This commit is contained in:
parent
2a7ae24c8e
commit
e63d25d41f
@ -10,8 +10,7 @@ Function Add-Blackfire() {
|
|||||||
$no_dot_version = $version.replace('.', '')
|
$no_dot_version = $version.replace('.', '')
|
||||||
$extension_version = $extension.split('-')[1]
|
$extension_version = $extension.split('-')[1]
|
||||||
if ($extension_version -notmatch "\S") {
|
if ($extension_version -notmatch "\S") {
|
||||||
$ext_data = Invoke-WebRequest https://blackfire.io/docs/up-and-running/update | ForEach-Object { $_.tostring() -split "[`r`n]" | Select-String '<td class="version">' | Select-Object -Index 2 }
|
$extension_version = (Invoke-RestMethod https://blackfire.io/api/v1/releases).probe.php
|
||||||
$extension_version = [regex]::Matches($ext_data, '<td.*?>(.+)</td>') | ForEach-Object { $_.Captures[0].Groups[1].value }
|
|
||||||
}
|
}
|
||||||
if (Test-Path $ext_dir\blackfire.dll) {
|
if (Test-Path $ext_dir\blackfire.dll) {
|
||||||
Enable-PhpExtension -Extension blackfire -Path $php_dir
|
Enable-PhpExtension -Extension blackfire -Path $php_dir
|
||||||
|
@ -267,8 +267,7 @@ Function Add-Pecl() {
|
|||||||
|
|
||||||
# Function to add blackfire and blackfire-agent.
|
# Function to add blackfire and blackfire-agent.
|
||||||
Function Add-Blackfire() {
|
Function Add-Blackfire() {
|
||||||
$agent_data = Invoke-WebRequest https://blackfire.io/docs/up-and-running/update | ForEach-Object { $_.tostring() -split "[`r`n]" | Select-String '<td class="version">' | Select-Object -Index 0 }
|
$agent_version = (Invoke-RestMethod https://blackfire.io/api/v1/releases).agent
|
||||||
$agent_version = [regex]::Matches($agent_data, '<td.*?>(.+)</td>') | ForEach-Object {$_.Captures[0].Groups[1].value }
|
|
||||||
$url = "https://packages.blackfire.io/binaries/blackfire-agent/${agent_version}/blackfire-agent-windows_${arch_name}.zip"
|
$url = "https://packages.blackfire.io/binaries/blackfire-agent/${agent_version}/blackfire-agent-windows_${arch_name}.zip"
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $bin_dir\blackfire.zip >$null 2>&1
|
Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $bin_dir\blackfire.zip >$null 2>&1
|
||||||
Expand-Archive -Path $bin_dir\blackfire.zip -DestinationPath $bin_dir -Force >$null 2>&1
|
Expand-Archive -Path $bin_dir\blackfire.zip -DestinationPath $bin_dir -Force >$null 2>&1
|
||||||
|
Loading…
Reference in New Issue
Block a user