Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #55847: DOTNET .NET 4.0 GAC new location #5949

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Contributor

@cmb69 cmb69 commented Aug 6, 2020

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.

@cmb69 cmb69 added the Bug label Aug 7, 2020
@nikic
Copy link
Member

nikic commented Aug 7, 2020

Looks sensible, but I'm not familiar with the subject matter.

@cmb69
Copy link
Contributor Author

cmb69 commented Aug 7, 2020

Thanks @nikic!

@derickr, would you generally be okay with this? It's introducing a new INI setting for PHP 7.4, but should otherwise be fully backward compatible.

@derickr
Copy link
Contributor

derickr commented Aug 7, 2020 via email

@cmb69
Copy link
Contributor Author

cmb69 commented Aug 10, 2020

Is there a really strong reason this can't wait until PHP 8?

If PHP 7.5 was next, there wouldn't, in my opinion, because users likely could upgrade within the next year. I don't see that the upgrade path to PHP 8 is as smooth, so a lot of code-bases may not be able to upgrade for some years. Still, these code-bases may benefit from being able to use the dotnet class instead of applying workarounds (regasm the assembly and use the com class, if the respective .NET classes even support COM interoperability).

@derickr
Copy link
Contributor

derickr commented Aug 10, 2020

I am never really much a fan of introducing ini settings, and I don't think it's wise to do this halfway through a cycle :-/.

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.
@cmb69 cmb69 changed the base branch from PHP-7.4 to master August 11, 2020 09:10
@cmb69
Copy link
Contributor Author

cmb69 commented Aug 11, 2020

I am never really much a fan of introducing ini settings, and I don't think it's wise to do this halfway through a cycle :-/.

I can't really argue against that, so I've switched to target the "master" branch instead.

@cmb69
Copy link
Contributor Author

cmb69 commented Aug 11, 2020

Closing and re-opening to retrigger CI.

@cmb69 cmb69 closed this Aug 11, 2020
@cmb69 cmb69 reopened this Aug 11, 2020
@cmb69
Copy link
Contributor Author

cmb69 commented Aug 14, 2020

If there are no objections, I'll merge this in a week.

@php-pulls php-pulls closed this in e6044d4 Aug 22, 2020
@cmb69 cmb69 deleted the cmb/55847 branch August 22, 2020 10:43
cmb69 added a commit to cmb69/doc-en that referenced this pull request Aug 22, 2020
php-pulls pushed a commit to php/doc-en that referenced this pull request Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants