com php-src: Deprecate case-insensitive constants via typelib import: NEWS UPGRADING ext/com_dotnet/com_com.c ext/com_dotnet/com _extension.c
| From: | Christoph Michael Becker | Date: | Fri, 15 Feb 2019 12:07:56 +0000 |
| Subject: | com php-src: Deprecate case-insensitive constants via typelib import: NEWS UPGRADING ext/com_dotnet/com_com.c ext/com_dotnet/com _extension.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104659@lists.php.net to get a copy of this message | ||
Commit: fae22461f95dfe8153fb74a53b9c5daeec47387f
Author: Christoph M. Becker <cmbecker69@gmx.de> Thu, 14 Feb 2019 18:34:47 +0100
Parents: ade9d5e95b879def3ce5b2b0c117ce1258c211ee
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fae22461f95dfe8153fb74a53b9c5daeec47387f
Log:
Deprecate case-insensitive constants via typelib import
As of PHP 7.3.0, case-insensitive constants are deprecated. We catch
up on this with regard to ext/com_dotnet, which allows to import
constants from typelibs, by triggering a deprecation notice whenever
com_load_typelib() is called with $case_sensitive being
false,
and whenever com.autoregister_casesensitive is set to false,
regardless of whether there are actually constants in the typelib which
would be imported.
Changed paths:
M NEWS
M UPGRADING
M ext/com_dotnet/com_com.c
M ext/com_dotnet/com_extension.c
Diff:
diff --git a/NEWS b/NEWS
index 35680ae..fbdc604 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ PHP NEWS
. Fixed bug #75921 (Inconsistent: No warning in some cases when stdObj is
created on the fly). (David Walker)
+- COM:
+ . Deprecated registering of case-insensitive constants from typelibs. (cmb)
+
- CURL:
. Fixed bug #76480 (Use curl_multi_wait() so that timeouts are respected).
(Pierrick)
diff --git a/UPGRADING b/UPGRADING
index ace9afd..d269bd2 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -149,6 +149,10 @@ PHP 7.4 UPGRADE NOTES
so is equivalent to calling a non-static method statically, which has been
deprecated since PHP 7.0.
+- COM:
+ . Importing type libraries with case-insensitive constant registering has been
+ deprecated.
+
- Mbstring:
. Passing a non-string pattern to mb_ereg_replace() is deprecated. Currently
non-string patterns are interpreted as ASCII codepoints. In PHP 8 the
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 9368969..6619cb4 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -831,6 +831,10 @@ PHP_FUNCTION(com_load_typelib)
return;
}
+ if (!cs) {
+ php_error_docref(NULL, E_DEPRECATED, "Declaration of case-insensitive constants is
deprecated");
+ }
+
RETVAL_FALSE;
php_com_initialize();
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index e4545ec..181f3ec 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -265,11 +265,19 @@ static PHP_INI_MH(OnTypeLibFileUpdate)
return SUCCESS;
}
+static ZEND_INI_MH(OnAutoregisterCasesensitive)
+{
+ if (!zend_ini_parse_bool(new_value)) {
+ php_error_docref("com.configuration", E_DEPRECATED, "Declaration of
case-insensitive constants is deprecated");
+ }
+ return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
+}
+
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("com.allow_dcom", "0", PHP_INI_SYSTEM, OnUpdateBool,
allow_dcom, zend_com_dotnet_globals, com_dotnet_globals)
STD_PHP_INI_ENTRY("com.autoregister_verbose", "0", PHP_INI_ALL,
OnUpdateBool, autoreg_verbose, zend_com_dotnet_globals, com_dotnet_globals)
STD_PHP_INI_ENTRY("com.autoregister_typelib", "0", PHP_INI_ALL,
OnUpdateBool, autoreg_on, zend_com_dotnet_globals, com_dotnet_globals)
- STD_PHP_INI_ENTRY("com.autoregister_casesensitive", "1", PHP_INI_ALL,
OnUpdateBool, autoreg_case_sensitive, zend_com_dotnet_globals, com_dotnet_globals)
+ 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_END()