summaryrefslogtreecommitdiff
path: root/ext/com_dotnet/com_extension.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-08-06 18:57:18 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-08-22 12:42:34 +0200
commite6044d4455d7fbaced7f3a6ac28172d963017e51 (patch)
tree31a91bbbc78709a3c339680231188a2558846b5e /ext/com_dotnet/com_extension.c
parent969a432fd8b34a0ec4e48e903370f0659aef6b04 (diff)
downloadphp-git-e6044d4455d7fbaced7f3a6ac28172d963017e51.tar.gz
Fix #55847: DOTNET .NET 4.0 GAC new location
If we do not specify the exact version of the .NET framework to use, the default CLR is loaded, which is typically CLR 2, which is very old. Therefore, we introduce a `PHP_INI_SYSTEM` setting, which allows users to choose the desired .NET framework version. The value of the setting are the first three parts of the framework's version number, separated by dots, and prefixed with "v", e.g. "v4.0.30319". If the value of the INI setting is `NULL` (the default) or an empty string, the default CLR is used. Internally, we switch from the most generic `CoCreateInstance()` to `CorBindToRuntime()` which is implemented in mscoree.dll. To avoid the hard dependency to that library, we load dynamically. So this fix is supposed to be fully backwards compatible. Closes GH-5949
Diffstat (limited to 'ext/com_dotnet/com_extension.c')
-rw-r--r--ext/com_dotnet/com_extension.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index 0535509412..5e2c1f69de 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -141,6 +141,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("com.autoregister_casesensitive", "1", PHP_INI_ALL, OnAutoregisterCasesensitive, autoreg_case_sensitive, zend_com_dotnet_globals, com_dotnet_globals)
STD_PHP_INI_ENTRY("com.code_page", "", PHP_INI_ALL, OnUpdateLong, code_page, zend_com_dotnet_globals, com_dotnet_globals)
PHP_INI_ENTRY("com.typelib_file", "", PHP_INI_SYSTEM, OnTypeLibFileUpdate)
+ PHP_INI_ENTRY("com.dotnet_version", NULL, PHP_INI_SYSTEM, NULL)
PHP_INI_END()
/* }}} */