Skip to content

Commit b28b0a2

Browse files
authored
Merge pull request #14853 from phalcon/4.0.x
4.0.4 Release
2 parents d234b7b + ab786cd commit b28b0a2

File tree

1,981 files changed

+22530
-20481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,981 files changed

+22530
-20481
lines changed

.ci/setup-dbs.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
# LICENSE.txt file that was distributed with this source code.
99

1010
(>&1 echo "Create MySQL database...")
11-
mysql -u root -e "CREATE DATABASE IF NOT EXISTS phalcon_test charset=utf8mb4 collate=utf8mb4_unicode_ci;"
12-
mysql -u root phalcon_test < ./tests/_data/assets/db/schemas/mysql_schema.sql
11+
mysql -u root -e "CREATE DATABASE IF NOT EXISTS phalcon charset=utf8mb4 collate=utf8mb4_unicode_ci;"
12+
#mysql -u root phalcon_test < ./tests/_data/assets/db/schemas/mysql_schema.sql
1313
(>&1 echo "Done.")
1414

1515
(>&1 echo "Create PostgreSQL database...")
16-
psql -c 'create database phalcon_test;' -U postgres
17-
psql -U postgres phalcon_test -q -f ./tests/_data/assets/db/schemas/postgresql_schema.sql
16+
psql -c 'create database phalcon;' -U postgres
17+
#psql -U postgres phalcon_test -q -f ./tests/_data/assets/db/schemas/postgresql_schema.sql
1818
(>&1 echo "Done.")
1919

20-
(>&1 echo "Create SQLite database...")
21-
sqlite3 ./tests/_output/phalcon_test.sqlite < ./tests/_data/assets/db/schemas/sqlite_schema.sql
22-
(>&1 echo "Done.")
20+
#(>&1 echo "Create SQLite database...")
21+
#sqlite3 ./tests/_output/phalcon_test.sqlite < ./tests/_data/assets/db/schemas/sqlite_schema.sql
22+
#(>&1 echo "Done.")
2323

24-
(>&1 echo "Create translations SQLite database...")
25-
sqlite3 ./tests/_output/translations.sqlite < ./tests/_data/assets/db/schemas/sqlite_translations_schema.sql
26-
(>&1 echo "Done.")
24+
#(>&1 echo "Create translations SQLite database...")
25+
#sqlite3 ./tests/_output/translations.sqlite < ./tests/_data/assets/db/schemas/sqlite_translations_schema.sql
26+
#(>&1 echo "Done.")
2727

2828
wait

.ci/vsenv.bat

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
@echo off
2+
rem This file is part of Phalcon.
3+
rem
4+
rem (c) Phalcon Team <[email protected]>
5+
rem
6+
rem For the full copyright and license information, please view
7+
rem the LICENSE file that was distributed with this source code.
8+
cls
9+
10+
rem For more see: https://github.com/microsoft/vswhere/wiki/Find-VC
11+
rem
12+
rem For the software installed on GitHub-hosted runners see:
13+
rem https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners
14+
rem
15+
echo "Find VC..."
16+
SET VSWHERE="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"
17+
18+
for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
19+
set InstallDir=%%i
20+
)
21+
22+
if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
23+
echo "Found %InstallDir%\Common7\Tools\vsdevcmd.bat"
24+
call "%InstallDir%\Common7\Tools\vsdevcmd.bat" %*
25+
) else "VC not found"
26+
27+
echo "------------- phpsdk-starter ---------------------------"
28+
call "%PHP_SDK_PATH%\phpsdk-vs16-%PHP_ARCH%.bat"
29+
30+
echo "------------- phpsdk_setvars ---------------------------"
31+
call "%PHP_SDK_PATH%\bin\phpsdk_setvars.bat"
32+
33+
rem Loop over all environment variables and make them global using set-env.
34+
rem
35+
rem See: https://help.github.com/en/articles/development-tools-for-github-actions#set-an-environment-variable-set-env
36+
rem See: https://stackoverflow.com/questions/39183272/loop-through-all-environmental-variables-and-take-actions-depending-on-prefix
37+
setlocal
38+
for /f "delims== tokens=1,2" %%a in ('set') do (
39+
echo ::set-env name=%%a::%%b
40+
)
41+
endlocal

.ci/win-ci-tools.psm1

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
# This file is part of Phalcon.
2+
#
3+
# (c) Phalcon Team <[email protected]>
4+
#
5+
# For the full copyright and license information, please view
6+
# the LICENSE file that was distributed with this source code.
7+
8+
Function SetupCommonEnvironment {
9+
If (-not (Test-Path 'C:\Downloads')) {
10+
New-Item -ItemType Directory -Force -Path 'C:\Downloads' | Out-Null
11+
}
12+
13+
If (-not (Test-Path 'C:\Downloads\Choco')) {
14+
New-Item -ItemType Directory -Force -Path 'C:\Downloads\Choco' | Out-Null
15+
}
16+
17+
# Hide "You are in 'detached HEAD' state" message
18+
git config --global advice.detachedHead false
19+
git config --global core.autocrlf false
20+
}
21+
22+
Function InstallPhpSdk {
23+
Write-Output "Install PHP SDK binary tools: ${env:PHP_SDK_VERSION}"
24+
25+
$RemoteUrl = "https://github.com/microsoft/php-sdk-binary-tools/archive/php-sdk-${env:PHP_SDK_VERSION}.zip"
26+
$DestinationPath = "C:\Downloads\php-sdk-${env:PHP_SDK_VERSION}.zip"
27+
28+
If (-not (Test-Path $env:PHP_SDK_PATH)) {
29+
If (-not [System.IO.File]::Exists($DestinationPath)) {
30+
Write-Output "Downloading PHP SDK binary tools: $RemoteUrl ..."
31+
DownloadFile $RemoteUrl $DestinationPath
32+
}
33+
34+
$DestinationUnzipPath = "${env:Temp}\php-sdk-binary-tools-php-sdk-${env:PHP_SDK_VERSION}"
35+
36+
If (-not (Test-Path "$DestinationUnzipPath")) {
37+
Expand-Item7zip $DestinationPath $env:Temp
38+
}
39+
40+
Move-Item -Path $DestinationUnzipPath -Destination $env:PHP_SDK_PATH
41+
}
42+
}
43+
44+
Function DownloadPhpSrc {
45+
Write-Output "Download PHP Src: ${env:PHP_VERSION}"
46+
47+
$RemoteUrl = "http://windows.php.net/downloads/releases/php-${env:PHP_VERSION}-src.zip"
48+
$DestinationPath = "C:\Downloads\php-${env:PHP_VERSION}-src.zip"
49+
50+
If (-not (Test-Path $env:PHP_SRC_PATH)) {
51+
If (-not [System.IO.File]::Exists($DestinationPath)) {
52+
Write-Output "Downloading PHP Dev pack: ${RemoteUrl} ..."
53+
DownloadFile $RemoteUrl $DestinationPath
54+
}
55+
56+
$DestinationUnzipPath = "${env:Temp}\php-${env:PHP_VERSION}-src"
57+
58+
If (-not (Test-Path "$DestinationUnzipPath")) {
59+
Expand-Item7zip $DestinationPath $env:Temp
60+
}
61+
62+
Move-Item -Path $DestinationUnzipPath -Destination $env:PHP_SRC_PATH
63+
}
64+
}
65+
66+
Function InstallPhpDevPack {
67+
Write-Output "Install PHP Dev pack: ${env:PHP_VERSION}"
68+
69+
$RemoteUrl = "http://windows.php.net/downloads/releases/php-devel-pack-${env:PHP_VERSION}-${env:BUILD_TYPE}-vc${env:VC_VERSION}-${env:PHP_ARCH}.zip"
70+
$DestinationPath = "C:\Downloads\php-devel-pack-${env:PHP_VERSION}-${env:BUILD_TYPE}-VC${env:VC_VERSION}-${env:PHP_ARCH}.zip"
71+
72+
If (-not (Test-Path $env:PHP_DEVPACK)) {
73+
If (-not [System.IO.File]::Exists($DestinationPath)) {
74+
Write-Output "Downloading PHP Dev pack: ${RemoteUrl} ..."
75+
DownloadFile $RemoteUrl $DestinationPath
76+
}
77+
78+
$DestinationUnzipPath = "${env:Temp}\php-${env:PHP_VERSION}-devel-VC${env:VC_VERSION}-${env:PHP_ARCH}"
79+
80+
If (-not (Test-Path "$DestinationUnzipPath")) {
81+
Expand-Item7zip $DestinationPath $env:Temp
82+
}
83+
84+
Move-Item -Path $DestinationUnzipPath -Destination $env:PHP_DEVPACK
85+
}
86+
}
87+
88+
89+
Function Expand-Item7zip {
90+
Param(
91+
[Parameter(Mandatory=$true)][System.String] $Archive,
92+
[Parameter(Mandatory=$true)][System.String] $Destination
93+
)
94+
95+
If (-not (Test-Path -Path $Archive -PathType Leaf)) {
96+
Throw "Specified archive File is invalid: [$Archive]"
97+
}
98+
99+
If (-not (Test-Path -Path $Destination -PathType Container)) {
100+
New-Item $Destination -ItemType Directory | Out-Null
101+
}
102+
103+
$Result = (& 7z x "$Archive" "-o$Destination" -aoa -bd -y -r)
104+
105+
If ($LastExitCode -ne 0) {
106+
Write-Output "An error occurred while unzipping [$Archive] to [$Destination]. Error code was: ${LastExitCode}"
107+
Exit $LastExitCode
108+
}
109+
}
110+
111+
Function DownloadFile {
112+
Param(
113+
[Parameter(Mandatory=$true)][System.String] $RemoteUrl,
114+
[Parameter(Mandatory=$true)][System.String] $DestinationPath
115+
)
116+
117+
$RetryMax = 5
118+
$RetryCount = 0
119+
$Completed = $false
120+
121+
$WebClient = New-Object System.Net.WebClient
122+
$WebClient.Headers.Add('User-Agent', 'GitHub Actions PowerShell Script')
123+
124+
While (-not $Completed) {
125+
Try {
126+
$WebClient.DownloadFile($RemoteUrl, $DestinationPath)
127+
$Completed = $true
128+
} Catch {
129+
If ($RetryCount -ge $RetryMax) {
130+
$ErrorMessage = $_.Exception.Message
131+
Write-Output "Error downloadingig ${RemoteUrl}: $ErrorMessage"
132+
$Completed = $true
133+
} Else {
134+
$RetryCount++
135+
}
136+
}
137+
}
138+
}
139+
140+
Function PrintLogs {
141+
If (Test-Path -Path "${env:GITHUB_WORKSPACE}\compile-errors.log") {
142+
Get-Content -Path "${env:GITHUB_WORKSPACE}\compile-errors.log"
143+
}
144+
145+
If (Test-Path -Path "${env:GITHUB_WORKSPACE}\compile.log") {
146+
Get-Content -Path "${env:GITHUB_WORKSPACE}\compile.log"
147+
}
148+
149+
If (Test-Path -Path "${env:GITHUB_WORKSPACE}\ext\configure.js") {
150+
Get-Content -Path "${env:GITHUB_WORKSPACE}\ext\configure.js"
151+
}
152+
}
153+
154+
Function PrintEnvVars {
155+
Write-Output ($env:Path).Replace(';', "`n")
156+
Get-ChildItem env:
157+
}
158+
159+
Function PrintDirectoriesContent {
160+
Get-ChildItem -Path "${env:GITHUB_WORKSPACE}"
161+
162+
If (Test-Path -Path "C:\Downloads") {
163+
Get-ChildItem -Path "C:\Downloads"
164+
}
165+
166+
If (Test-Path -Path "C:\Projects") {
167+
Get-ChildItem -Path "C:\Projects"
168+
}
169+
170+
If (Test-Path -Path "${env:PHPROOT}\ext") {
171+
Get-ChildItem -Path "${env:PHPROOT}\ext"
172+
}
173+
174+
$ReleasePath = Split-Path -Path "${env:RELEASE_DLL_PATH}"
175+
If (Test-Path -Path "${ReleasePath}") {
176+
Get-ChildItem -Path "${ReleasePath}"
177+
}
178+
179+
$BuildPath = Split-Path -Path "${ReleasePath}"
180+
If (Test-Path -Path "${BuildPath}") {
181+
Get-ChildItem -Path "${BuildPath}"
182+
}
183+
}
184+
185+
# TODO(klay): Add phpize and phpconfig here
186+
Function PrintPhpInfo {
187+
$IniFile = "${env:PHPROOT}\php.ini"
188+
$PhpExe = "${env:PHPROOT}\php.exe"
189+
190+
If (Test-Path -Path "${PhpExe}") {
191+
Write-Output ""
192+
& "${PhpExe}" -v
193+
194+
Write-Output ""
195+
& "${PhpExe}" -m
196+
197+
Write-Output ""
198+
& "${PhpExe}" -i
199+
} ElseIf (Test-Path -Path "${IniFile}") {
200+
Get-Content -Path "${IniFile}"
201+
}
202+
}
203+
204+
Function PrintBuildDetails {
205+
$BuildDate = Get-Date -Format g
206+
207+
Write-Output "Build date: ${BuildDate}"
208+
Write-Output "Git commit: ${env:GITHUB_SHA}"
209+
Write-Output "Target PHP version: ${env:PHP_MINOR}"
210+
Write-Output "PHP SDK Toolset Version: ${env:PHP_SDK_VC_TOOLSET_VER}"
211+
Write-Output "Build Worker Image Version: ${env:ImageVersion}"
212+
Write-Output "Processor ID: ${env:PROCESSOR_IDENTIFIER}"
213+
Write-Output "Processor Architecture: ${env:PROCESSOR_ARCHITECTURE}"
214+
Write-Output "Number of Processors: ${env:NUMBER_OF_PROCESSORS}"
215+
Write-Output "Visual Studio Version: ${env:VisualStudioVersion}"
216+
Write-Output "Host Architecture: ${env:VSCMD_ARG_HOST_ARCH}"
217+
Write-Output "Target Architecture: ${env:VSCMD_ARG_TGT_ARCH}"
218+
Write-Output "VC Tools Version: ${env:VCToolsVersion}"
219+
Write-Output "Windows SDK Version: ${env:WindowsSDKVersion}"
220+
}
221+
222+
223+
Function InitializeReleaseVars {
224+
If ($env:BUILD_TYPE -Match "nts-Win32") {
225+
$env:RELEASE_ZIPBALL = "${env:PACKAGE_PREFIX}_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}_nts"
226+
227+
If ($env:PHP_ARCH -eq 'x86') {
228+
$env:RELEASE_FOLDER = "Release"
229+
} Else {
230+
$env:RELEASE_FOLDER = "x64\Release"
231+
}
232+
} Else {
233+
$env:RELEASE_ZIPBALL = "${env:PACKAGE_PREFIX}_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}"
234+
235+
If ($env:PHP_ARCH -eq 'x86') {
236+
$env:RELEASE_FOLDER = "Release_TS"
237+
} Else {
238+
$env:RELEASE_FOLDER = "x64\Release_TS"
239+
}
240+
}
241+
242+
$env:RELEASE_DLL_PATH = "${env:PHP_PECL_PATH}\phalcon\phalcon-${env:PHALCON_VERSION}\${env:RELEASE_FOLDER}\${env:EXTENSION_FILE}"
243+
244+
Write-Output "::set-env name=RELEASE_ZIPBALL::${env:RELEASE_ZIPBALL}"
245+
Write-Output "::set-env name=RELEASE_DLL_PATH::${env:RELEASE_DLL_PATH}"
246+
}
247+
248+
Function EnablePhalconExtension {
249+
if (-not (Test-Path env:RELEASE_DLL_PATH)) {
250+
InitializeReleaseVars
251+
}
252+
253+
If (-not (Test-Path "${env:RELEASE_DLL_PATH}")) {
254+
Throw "Unable to locate extension path: ${env:RELEASE_DLL_PATH}"
255+
}
256+
257+
Copy-Item "${env:RELEASE_DLL_PATH}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}"
258+
259+
Enable-PhpExtension -Extension "${env:EXTENSION_NAME}" -Path "${env:PHPROOT}"
260+
}

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ build/php5/* linguist-vendored
88
build/php7/* linguist-vendored
99

1010
*.png binary
11+
12+
tests/_data/assets/assets/* -text

.github/ISSUE_TEMPLATE.md.bak

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)