mirror of
https://github.com/ScoopInstaller/Main.git
synced 2025-11-08 01:31:20 +00:00
Improve PHP configuration persistence by using multiple directories in PHP_INI_SCAN_DIR
This commit is contained in:
parent
f796d12511
commit
06b9ce1b84
13
php-nts.json
13
php-nts.json
@ -29,18 +29,23 @@
|
|||||||
"php-cgi.exe"
|
"php-cgi.exe"
|
||||||
],
|
],
|
||||||
"persist": [
|
"persist": [
|
||||||
"conf",
|
"cli",
|
||||||
[
|
[
|
||||||
"php.ini-production",
|
"php.ini-production",
|
||||||
"conf\\php.ini"
|
"cli\\php.ini"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"env_set": {
|
"env_set": {
|
||||||
"PHP_INI_SCAN_DIR": "$dir\\conf"
|
"PHP_INI_SCAN_DIR": "$dir\\cli;$dir\\cli\\conf.d;"
|
||||||
},
|
},
|
||||||
"post_install": "
|
"post_install": "
|
||||||
|
# Create directory for custom PHP configuration
|
||||||
|
if(!(Test-Path \"$dir\\cli\\conf.d\")) {
|
||||||
|
(New-Item -Type directory \"$dir\\cli\\conf.d\") | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
# Enable extensions to be found in installation-relative folder (the default is to search C:/php)
|
# Enable extensions to be found in installation-relative folder (the default is to search C:/php)
|
||||||
(gc \"$dir\\conf\\php.ini\") | % { $_ -replace '; extension_dir = \"ext\"', 'extension_dir = \"ext\"' } | sc \"$dir\\conf\\php.ini\"
|
(gc \"$dir\\cli\\php.ini\") | % { $_ -replace '; extension_dir = \"ext\"', 'extension_dir = \"ext\"' } | sc \"$dir\\cli\\php.ini\"
|
||||||
",
|
",
|
||||||
"checkver": {
|
"checkver": {
|
||||||
"url": "http://windows.php.net/download/",
|
"url": "http://windows.php.net/download/",
|
||||||
|
|||||||
19
php.json
19
php.json
@ -29,24 +29,29 @@
|
|||||||
"php-cgi.exe"
|
"php-cgi.exe"
|
||||||
],
|
],
|
||||||
"persist": [
|
"persist": [
|
||||||
"conf",
|
"cli",
|
||||||
[
|
[
|
||||||
"php.ini-production",
|
"php.ini-production",
|
||||||
"conf\\php.ini"
|
"cli\\php.ini"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"env_set": {
|
"env_set": {
|
||||||
"PHP_INI_SCAN_DIR": "$dir\\conf"
|
"PHP_INI_SCAN_DIR": "$dir\\cli;$dir\\cli\\conf.d;"
|
||||||
},
|
},
|
||||||
"post_install": "
|
"post_install": "
|
||||||
|
# Create directory for custom PHP configuration
|
||||||
|
if(!(Test-Path \"$dir\\cli\\conf.d\")) {
|
||||||
|
(New-Item -Type directory \"$dir\\cli\\conf.d\") | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
# Copy ini scan dir from old location before persistent update
|
# Copy ini scan dir from old location before persistent update
|
||||||
if ((Test-Path \"$dir\\..\\conf\") -and !(Test-Path \"$dir\\conf\")) {
|
if ((Test-Path \"$dir\\..\\conf\") -and !(Test-Path \"$dir\\cli\\conf.d\")) {
|
||||||
Write-Host -ForegroundColor Cyan 'We are moving your php configuration to $dir\\conf'
|
Write-Host -ForegroundColor Cyan 'We are moving your php configuration to $dir\\cli\\conf.d'
|
||||||
Move-Item \"$dir\\..\\conf\" \"$dir\\conf\"
|
Move-Item \"$dir\\..\\conf\" \"$dir\\cli\\conf.d\"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Enable extensions to be found in installation-relative folder (the default is to search C:/php)
|
# Enable extensions to be found in installation-relative folder (the default is to search C:/php)
|
||||||
(gc \"$dir\\conf\\php.ini\") | % { $_ -replace '; extension_dir = \"ext\"', 'extension_dir = \"ext\"' } | sc \"$dir\\conf\\php.ini\"
|
(gc \"$dir\\cli\\php.ini\") | % { $_ -replace '; extension_dir = \"ext\"', 'extension_dir = \"ext\"' } | sc \"$dir\\cli\\php.ini\"
|
||||||
",
|
",
|
||||||
"checkver": {
|
"checkver": {
|
||||||
"url": "http://windows.php.net/download/",
|
"url": "http://windows.php.net/download/",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user