Skip to content

Commit 452ee07

Browse files
committed
Replace version with master
1 parent c85a974 commit 452ee07

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ jobs:
6969
mkdir builds
7070
Get-ChildItem C:\php-snap-build\${{ matrix.target }}\* -Recurse -Include php-*.zip | Foreach-Object { Copy-Item -Path $_ -Destination .\builds }
7171
Copy-Item -Path C:\php-snap-build\rmtools\data\db\master.json -Destination .\builds\${{ matrix.config }}.json
72+
$php_version = Invoke-RestMethod https://raw.githubusercontent.com/php/php-src/master/main/php_version.h | Where-Object { $_ -match 'PHP_VERSION "(.*)"' } | Foreach-Object {$Matches[1]}
7273
Get-ChildItem .\builds *.zip | Rename-Item -NewName { $_.name -replace "win32","windows" }
74+
if(("${{ matrix.config }}" -eq "ts-windows-vs16-x64") -or ("${{ matrix.config }}" -eq "ts-windows-vs16-x86")) {
75+
Get-ChildItem .\builds *.zip | Rename-Item -NewName { $_.name -replace $php_version,"master-ts" }
76+
} else {
77+
Get-ChildItem .\builds *.zip | Rename-Item -NewName { $_.name -replace $php_version,"master" }
78+
}
7379
- name: Upload Artifact
7480
uses: actions/upload-artifact@v2
7581
with:

Install-PhpMaster.ps1

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<#
2+
.Synopsis
3+
Installs PHP nightly.
4+
.Description
5+
Download and installs a nightly version of PHP.
6+
.Parameter Architecture
7+
The architecture of the PHP to be installed (x86 for 32-bit, x64 for 64-bit).
8+
.Parameter ThreadSafe
9+
A boolean value to indicate if the Thread-Safe version should be installed or not.
10+
You usually install the ThreadSafe version if you plan to use PHP with Apache, or the NonThreadSafe version if you'll use PHP in CGI mode.
11+
.Parameter Path
12+
The path of the directory where PHP will be installed.
13+
#>
14+
param (
15+
[Parameter(Mandatory = $true, Position = 1, HelpMessage = 'Architecture of the PHP to be installed (x86 for 32-bit, x64 for 64-bit)')]
16+
[ValidateSet('x86', 'x64')]
17+
[string] $Architecture,
18+
[Parameter(Mandatory = $true, Position = 2, HelpMessage = 'Install a Thread-Safe version?')]
19+
[bool] $ThreadSafe,
20+
[Parameter(Mandatory = $true, Position = 3, HelpMessage = 'The path of the directory where PHP will be installed')]
21+
[ValidateLength(1, [int]::MaxValue)]
22+
[string] $Path
23+
)
24+
if(-not(Test-Path $Path)) {
25+
New-Item -Type 'directory' $Path
26+
}
27+
$ts = 'nts'
28+
if($ThreadSafe) {
29+
$ts = 'ts'
30+
}
31+
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.bintray.com/shivammathur/php/php-master-$ts-windows-vs16-$Architecture.zip" -OutFile $Path\master.zip
32+
Expand-Archive -Path $Path\master.zip -DestinationPath $Path -Force
33+
Copy-Item $Path\php.ini-production -Destination $Path\php.ini
34+
"xdebug", "pcov" | ForEach-Object { Invoke-WebRequest -UseBasicParsing -Uri "https://github.com/shivammathur/php-extensions-windows/releases/latest/download/php_$ts`_$Architecture`_$_.dll" -OutFile $Path"\ext\php`_$_.dll" }
35+
$ini_content = @"
36+
extension_dir=$Path\ext
37+
default_charset=UTF-8
38+
zend_extension=php_opcache.dll
39+
opcache.jit_buffer_size=256M
40+
opcache.jit=1235
41+
"@
42+
Add-Content -Path $Path\php.ini -Value $ini_content

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22

33
<a href="https://github.com/shivammathur/php-builder-windows" title="PHP Builder Windows"><img alt="Build status" src="https://github.com/shivammathur/php-builder-windows/workflows/Build%20PHP/badge.svg"></a>
44
<a href="https://github.com/shivammathur/php-builder-windows/blob/main/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg"></a>
5-
<a href="https://github.com/shivammathur/php-builder-windows" title="builds"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg"></a>
5+
<a href="https://github.com/shivammathur/php-builder-windows#Builds" title="builds"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg"></a>
66

77
> Build PHP nightly for windows.
88
9+
## Builds
10+
- [php-master-nts-windows-vs16-x64.zi](https://bintray.com/shivammathur/php/php-master-nts-windows-vs16-x64.zip)
11+
- [php-master-nts-windows-vs16-x64-AVX.zip](https://bintray.com/shivammathur/php/php-master-ts-windows-vs16-x64-AVX.zip)
12+
- [php-master-ts-windows-vs16-x64.zip](https://bintray.com/shivammathur/php/php-master-ts-windows-vs16-x64.zip)
13+
- [php-master-nts-windows-vs16-x86.zip](https://bintray.com/shivammathur/php/php-master-nts-windows-vs16-x86.zip)
14+
- [php-master-ts-windows-vs16-x86.zip](https://bintray.com/shivammathur/php/php-master-ts-windows-vs16-x86.zip)
15+
916
## License
1017

1118
The code in this project is licensed under the [MIT license](http://choosealicense.com/licenses/mit/).

0 commit comments

Comments
 (0)