Add OpenSSL config on Windows

This commit is contained in:
Shivam Mathur 2022-02-13 03:20:39 +05:30
parent 5bf95cd61f
commit 7ad352e12a
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -184,6 +184,17 @@ Function Add-PhpCAInfo {
} }
} }
# Function to set OpenSSL config.
Function Add-OpenSSLConf {
try {
Set-OpenSSLConf -Target User
} catch {
New-Item $php_dir\extras\openssl.cnf -Type File -Force > $null 2>&1
Set-OpenSSLConf -Path $php_dir\extras\openssl.cnf -Target User
}
Add-Env -EnvName OPENSSL_CONF -EnvValue $env:OPENSSL_CONF
}
# Function to set PHP config. # Function to set PHP config.
Function Add-PhpConfig { Function Add-PhpConfig {
$current = Get-Content -Path $php_dir\php.ini-current -ErrorAction SilentlyContinue $current = Get-Content -Path $php_dir\php.ini-current -ErrorAction SilentlyContinue
@ -348,6 +359,7 @@ if($version -lt "5.5") {
} }
Enable-PhpExtension -Extension $enable_extensions -Path $php_dir Enable-PhpExtension -Extension $enable_extensions -Path $php_dir
Add-PhpCAInfo Add-PhpCAInfo
Add-OpenSSLConf
Copy-Item -Path $src\configs\pm\*.json -Destination $env:RUNNER_TOOL_CACHE Copy-Item -Path $src\configs\pm\*.json -Destination $env:RUNNER_TOOL_CACHE
Set-Output php-version $($installed.FullVersion) Set-Output php-version $($installed.FullVersion)
Add-Log $tick "PHP" "$status PHP $($installed.FullVersion)$extra_version" Add-Log $tick "PHP" "$status PHP $($installed.FullVersion)$extra_version"