Skip to content

Commit

Permalink
Remove bintray from manifest and win32.ps1
Browse files Browse the repository at this point in the history
Fix JIT ini values in win32.ps1
  • Loading branch information
shivammathur committed Feb 23, 2021
1 parent 399ab79 commit fa18c2b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2715,7 +2715,7 @@ exports.fetch = fetch;
* @param version
*/
async function parseVersion(version) {
const manifest = 'https://dl.bintray.com/shivammathur/php/php-versions.json';
const manifest = 'https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/php-versions.json';
switch (true) {
case /^(latest|\d+\.x)$/.test(version):
return JSON.parse(await fetch(manifest))[version];
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ run_script() {
repo=$1
shift
args=("$@")
get -q -e /tmp/install.sh "$bintray/php/$repo.sh" "$github/$repo/$latest/install.sh"
get -q -e /tmp/install.sh "$github/$repo/$latest/install.sh" "$bintray/php/$repo.sh"
bash /tmp/install.sh "${args[@]}"
}

Expand Down
12 changes: 8 additions & 4 deletions src/scripts/win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ $composer_json = "$env:APPDATA\Composer\composer.json"
$composer_lock = "$env:APPDATA\Composer\composer.lock"
$current_profile = "$env:TEMP\setup-php.ps1"
$ProgressPreference = 'SilentlyContinue'
$nightly_version = '8.[0-9]'
$jit_versions = '8.[0-9]'
$nightly_versions = '8.[1-9]'
$cert_source='CurrentUser'
$enable_extensions = ('openssl', 'curl', 'mbstring')

Expand Down Expand Up @@ -399,14 +400,17 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" >$null 2>&1
}
try {
if ($version -match $nightly_version) {
Invoke-WebRequest -Uri $bintray/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
& $php_dir\Get-PhpNightly.ps1 -Architecture $arch -ThreadSafe $ts -Path $php_dir -Version $version > $null 2>&1
if ($version -match $nightly_versions) {
Invoke-WebRequest -UseBasicParsing -Uri https://github.com/shivammathur/php-builder-windows/releases/latest/download/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
& $php_dir\Get-PhpNightly.ps1 -Architecture $arch -ThreadSafe $ts -Path $php_dir > $null 2>&1
} else {
Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force > $null 2>&1
}
} catch { }
} else {
if($version -match $jit_versions) {
('opcache.enable=1', 'opcache.jit_buffer_size=256M', 'opcache.jit=1235') | ForEach-Object { $p=$_.split('='); Set-PhpIniKey -Key $p[0] -Value $p[1] -Path $php_dir }
}
if($env:update -eq 'true') {
Update-Php $php_dir >$null 2>&1
$status = "Updated to"
Expand Down
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export async function fetch(url: string): Promise<string> {
* @param version
*/
export async function parseVersion(version: string): Promise<string> {
const manifest = 'https://dl.bintray.com/shivammathur/php/php-versions.json';
const manifest =
'https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/php-versions.json';
switch (true) {
case /^(latest|\d+\.x)$/.test(version):
return JSON.parse(await fetch(manifest))[version];
Expand Down

0 comments on commit fa18c2b

Please sign in to comment.