]> granicus.if.org Git - php/commitdiff
Generate class entries from stubs for oci8, odbc, openssl, pcntl, pdo, pgsql
authorMáté Kocsis <kocsismate@woohoolabs.com>
Sun, 14 Feb 2021 11:00:03 +0000 (12:00 +0100)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Sun, 14 Feb 2021 22:19:21 +0000 (23:19 +0100)
Closes GH-6691

22 files changed:
ext/oci8/oci8.c
ext/oci8/oci8.stub.php
ext/oci8/oci8_arginfo.h
ext/odbc/odbc.stub.php
ext/odbc/odbc_arginfo.h
ext/opcache/opcache.stub.php
ext/opcache/opcache_arginfo.h
ext/openssl/openssl.c
ext/openssl/openssl.stub.php
ext/openssl/openssl_arginfo.h
ext/pcntl/pcntl.stub.php
ext/pcntl/pcntl_arginfo.h
ext/pcre/php_pcre.stub.php
ext/pcre/php_pcre_arginfo.h
ext/pdo/pdo.c
ext/pdo/pdo.stub.php
ext/pdo/pdo_arginfo.h
ext/pdo/pdo_dbh.c
ext/pdo/pdo_dbh.stub.php
ext/pdo/pdo_dbh_arginfo.h
ext/pgsql/pgsql.stub.php
ext/pgsql/pgsql_arginfo.h

index c333a4d3a4b82e036a6c29de5e86667cacc912aa..93fba39c17f642a263963b7d4f98d9746e24fe36 100644 (file)
@@ -279,9 +279,6 @@ static PHP_GSHUTDOWN_FUNCTION(oci)
 
 PHP_MINIT_FUNCTION(oci)
 {
-       zend_class_entry oci_lob_class_entry;
-       zend_class_entry oci_coll_class_entry;
-
        REGISTER_INI_ENTRIES();
 
        le_statement = zend_register_list_destructors_ex(php_oci_statement_list_dtor, NULL, "oci8 statement", module_number);
@@ -291,11 +288,8 @@ PHP_MINIT_FUNCTION(oci)
        le_descriptor = zend_register_list_destructors_ex(php_oci_descriptor_list_dtor, NULL, "oci8 descriptor", module_number);
        le_collection = zend_register_list_destructors_ex(php_oci_collection_list_dtor, NULL, "oci8 collection", module_number);
 
-       INIT_CLASS_ENTRY(oci_lob_class_entry, "OCILob", class_OCILob_methods);
-       INIT_CLASS_ENTRY(oci_coll_class_entry, "OCICollection", class_OCICollection_methods);
-
-       oci_lob_class_entry_ptr = zend_register_internal_class(&oci_lob_class_entry);
-       oci_coll_class_entry_ptr = zend_register_internal_class(&oci_coll_class_entry);
+       oci_lob_class_entry_ptr = register_class_OCILob();
+       oci_coll_class_entry_ptr = register_class_OCICollection();
 
 /* thies@thieso.net 990203 i do not think that we will need all of them - just in here for completeness for now! */
        REGISTER_LONG_CONSTANT("OCI_DEFAULT",OCI_DEFAULT, CONST_CS | CONST_PERSISTENT);
index ee8ea98b5430be763a617d62a7a60358c018bf7d..b7d47d5dc9597fde7372217bfb9555de4c023eac 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 /** @param resource $statement */
 function oci_define_by_name($statement, string $column, mixed &$var, int $type = 0): bool {}
index 4486036c4905e309a43529314f7d775339a621e7..db19754fe8fd439c5283fda7653c2573bc0781c9 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: e7a7a9402b2668136f9f47d6e547e3af46a78a50 */
+ * Stub hash: f96a1c7a278551bf334eab82a69710c3418beebf */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_define_by_name, 0, 3, _IS_BOOL, 0)
        ZEND_ARG_INFO(0, statement)
@@ -789,3 +789,24 @@ static const zend_function_entry class_OCICollection_methods[] = {
        ZEND_ME_MAPPING(trim, oci_collection_trim, arginfo_class_OCICollection_trim, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_OCILob()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "OCILob", class_OCILob_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
+zend_class_entry *register_class_OCICollection()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "OCICollection", class_OCICollection_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index e241022e1049c59b245eac6fa568235444929537..fc19ca259f32e525b4a0bcc82beb7a7b1445c898 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 function odbc_close_all(): void {}
 
index 974edf32f082472916454367365f43612b1858c4..71f76f5aaea7a7030e010f1323be9861a6513fe5 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: dd2205269dd48e1af19c3980291b21d86fa11a93 */
+ * Stub hash: 6d7d8d8f495236297745b9b1087e5cf955976127 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_close_all, 0, 0, IS_VOID, 0)
 ZEND_END_ARG_INFO()
@@ -375,3 +375,4 @@ static const zend_function_entry ext_functions[] = {
 #endif
        ZEND_FE_END
 };
+
index 34cc78971715774d8773f12dc40bd72141786477..ba65b9a264db3e661213215c55a26da8b39a9d2f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 function opcache_reset(): bool {}
 
index 5085255a0f15f048bb9e5392008c48d9189270f3..75449332311adc5ee4ea18859883ee33ec0d5303 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 06a37b4af6a0fb5d7bd24b1660ea8ce09e959ec8 */
+ * Stub hash: 919d85eb3f3e1127ea3911051f1d98340e84654e */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_opcache_reset, 0, 0, _IS_BOOL, 0)
 ZEND_END_ARG_INFO()
@@ -40,3 +40,4 @@ static const zend_function_entry ext_functions[] = {
        ZEND_FE(opcache_is_script_cached, arginfo_opcache_is_script_cached)
        ZEND_FE_END
 };
+
index 06195004f1338c3e0f15fb2d9537b5bec919c405..3c94af9c363dacdd1a5766334c4f0d6cb670b8b7 100644 (file)
@@ -1101,10 +1101,7 @@ PHP_MINIT_FUNCTION(openssl)
 {
        char * config_filename;
 
-       zend_class_entry ce;
-       INIT_CLASS_ENTRY(ce, "OpenSSLCertificate", class_OpenSSLCertificate_methods);
-       php_openssl_certificate_ce = zend_register_internal_class(&ce);
-       php_openssl_certificate_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+       php_openssl_certificate_ce = register_class_OpenSSLCertificate();
        php_openssl_certificate_ce->create_object = php_openssl_certificate_create_object;
        php_openssl_certificate_ce->serialize = zend_class_serialize_deny;
        php_openssl_certificate_ce->unserialize = zend_class_unserialize_deny;
@@ -1115,10 +1112,7 @@ PHP_MINIT_FUNCTION(openssl)
        php_openssl_certificate_object_handlers.get_constructor = php_openssl_certificate_get_constructor;
        php_openssl_certificate_object_handlers.clone_obj = NULL;
 
-       zend_class_entry csr_ce;
-       INIT_CLASS_ENTRY(csr_ce, "OpenSSLCertificateSigningRequest", class_OpenSSLCertificateSigningRequest_methods);
-       php_openssl_request_ce = zend_register_internal_class(&csr_ce);
-       php_openssl_request_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+       php_openssl_request_ce = register_class_OpenSSLCertificateSigningRequest();
        php_openssl_request_ce->create_object = php_openssl_request_create_object;
        php_openssl_request_ce->serialize = zend_class_serialize_deny;
        php_openssl_request_ce->unserialize = zend_class_unserialize_deny;
@@ -1129,10 +1123,7 @@ PHP_MINIT_FUNCTION(openssl)
        php_openssl_request_object_handlers.get_constructor = php_openssl_request_get_constructor;
        php_openssl_request_object_handlers.clone_obj = NULL;
 
-       zend_class_entry key_ce;
-       INIT_CLASS_ENTRY(key_ce, "OpenSSLAsymmetricKey", class_OpenSSLAsymmetricKey_methods);
-       php_openssl_pkey_ce = zend_register_internal_class(&key_ce);
-       php_openssl_pkey_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+       php_openssl_pkey_ce = register_class_OpenSSLAsymmetricKey();
        php_openssl_pkey_ce->create_object = php_openssl_pkey_create_object;
        php_openssl_pkey_ce->serialize = zend_class_serialize_deny;
        php_openssl_pkey_ce->unserialize = zend_class_unserialize_deny;
index e77f4e4043a7870f08db227430c17fbd69643b05..db49af3126298d146081d71228fbc2ccae458da2 100644 (file)
@@ -1,15 +1,18 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
+/** @strict-properties */
 final class OpenSSLCertificate
 {
 }
 
+/** @strict-properties */
 final class OpenSSLCertificateSigningRequest
 {
 }
 
+/** @strict-properties */
 final class OpenSSLAsymmetricKey
 {
 }
index 1e30d9c2c172fa06992ec4367d22812443fef495..26e6c2d105fb2926c88c0a4e40cf3999aed656c9 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: d4f73f86e6f16a74ab5b60bb79c4a9f29e9bc4fb */
+ * Stub hash: e881a9190424d49fa39ac76f6c13044b65ba2f7f */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_export_to_file, 0, 2, _IS_BOOL, 0)
        ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
@@ -530,3 +530,37 @@ static const zend_function_entry class_OpenSSLCertificateSigningRequest_methods[
 static const zend_function_entry class_OpenSSLAsymmetricKey_methods[] = {
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_OpenSSLCertificate()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "OpenSSLCertificate", class_OpenSSLCertificate_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+
+       return class_entry;
+}
+
+zend_class_entry *register_class_OpenSSLCertificateSigningRequest()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "OpenSSLCertificateSigningRequest", class_OpenSSLCertificateSigningRequest_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+
+       return class_entry;
+}
+
+zend_class_entry *register_class_OpenSSLAsymmetricKey()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "OpenSSLAsymmetricKey", class_OpenSSLAsymmetricKey_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+
+       return class_entry;
+}
+
index ea66c9f898369a08a4d5def8068cdd974198df94..53c9b607ad8c6cbc521622f1db7e9c23a2b173dd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 function pcntl_fork(): int {}
 
index 87a2579c9bbad7c5a2c3bf1e084b1aba7a204bde..7076a19ec91ff523d2c1d28edb311effeaae0e0c 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 8742901e9b4fe5ee595a1e7c492474723f95d253 */
+ * Stub hash: dc44f2c96c13457cd6acae4897d6e416403e6756 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_fork, 0, 0, IS_LONG, 0)
 ZEND_END_ARG_INFO()
@@ -202,3 +202,4 @@ static const zend_function_entry ext_functions[] = {
 #endif
        ZEND_FE_END
 };
+
index b2862a2f62ee1f274194be89696fc315e35bc7b2..54cb8426760202fdb3dd372835c926309fb3ae96 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 /** @param array $matches */
 function preg_match(string $pattern, string $subject, &$matches = null, int $flags = 0, int $offset = 0): int|false {}
index c53f35559e36b0265c45aa660269d5bbca1c473a..c92c1681ff8ee4fb4f2837299ac38861c10960d4 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 2e5a9edc9635edd4f5a00e9d888fb34c1746a5b8 */
+ * Stub hash: 861429ae51cfa064e85c0c1c1972707c28869f56 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_preg_match, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
@@ -96,3 +96,4 @@ static const zend_function_entry ext_functions[] = {
        ZEND_FE(preg_last_error_msg, arginfo_preg_last_error_msg)
        ZEND_FE_END
 };
+
index b3d999bed549c576413ac592242313bdf26617af..a62e3f6bc3efd8f00eb067460c72666f3d70e320 100644 (file)
@@ -292,8 +292,6 @@ PDO_API zend_string *php_pdo_int64_to_str(int64_t i64) /* {{{ */
 /* {{{ PHP_MINIT_FUNCTION */
 PHP_MINIT_FUNCTION(pdo)
 {
-       zend_class_entry ce;
-
        if (FAILURE == pdo_sqlstate_init_error_table()) {
                return FAILURE;
        }
@@ -303,11 +301,7 @@ PHP_MINIT_FUNCTION(pdo)
        le_ppdo = zend_register_list_destructors_ex(NULL, php_pdo_pdbh_dtor,
                "PDO persistent database", module_number);
 
-       INIT_CLASS_ENTRY(ce, "PDOException", class_PDOException_methods);
-
-       pdo_exception_ce = zend_register_internal_class_ex(&ce, spl_ce_RuntimeException);
-
-       zend_declare_property_null(pdo_exception_ce, "errorInfo", sizeof("errorInfo")-1, ZEND_ACC_PUBLIC);
+       pdo_exception_ce = register_class_PDOException(spl_ce_RuntimeException);
 
        pdo_dbh_init();
        pdo_stmt_init();
index 35404cade644a054161979e69914dddeb2697e84..6d6d070cd79af81376035904de9597aa56215631 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class PDOException extends RuntimeException
 {
index fc9e52de9e5d24b93707ecad19c722cdbbe4a9aa..63343ca2aaa56b51c631ec2c0af2bcdc2409a012 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 68f2e4abc1071fdf8046695264de5768a8c10719 */
+ * Stub hash: e5e41e3d0ae7a506b43996b6071047755a39d61a */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pdo_drivers, 0, 0, IS_ARRAY, 0)
 ZEND_END_ARG_INFO()
@@ -17,3 +17,20 @@ static const zend_function_entry ext_functions[] = {
 static const zend_function_entry class_PDOException_methods[] = {
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_PDOException(zend_class_entry *class_entry_RuntimeException)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "PDOException", class_PDOException_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_RuntimeException);
+
+       zval property_errorInfo_default_value;
+       ZVAL_NULL(&property_errorInfo_default_value);
+       zend_string *property_errorInfo_name = zend_string_init("errorInfo", sizeof("errorInfo") - 1, 1);
+       zend_declare_property_ex(class_entry, property_errorInfo_name, &property_errorInfo_default_value, ZEND_ACC_PUBLIC, NULL);
+       zend_string_release(property_errorInfo_name);
+
+       return class_entry;
+}
+
index c1b3495a1b30fafc01b02c65b6dc8c08421a59e4..3ef312cbe036182cebef4c73f743a8bd35a4c7d1 100644 (file)
@@ -1289,10 +1289,7 @@ static void pdo_dbh_free_storage(zend_object *std);
 
 void pdo_dbh_init(void)
 {
-       zend_class_entry ce;
-
-       INIT_CLASS_ENTRY(ce, "PDO", class_PDO_methods);
-       pdo_dbh_ce = zend_register_internal_class(&ce);
+       pdo_dbh_ce = register_class_PDO();
        pdo_dbh_ce->create_object = pdo_dbh_new;
        pdo_dbh_ce->serialize = zend_class_serialize_deny;
        pdo_dbh_ce->unserialize = zend_class_unserialize_deny;
index adca7d6b7a263b75e7b543fe55549e6a0628357b..d25408db7e197faf8e9f77baebbfafbe48a4f998 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class PDO
 {
index ac2fc76350f91ef075c4e6fb2ca1b5665d31f8f8..ae563a7399d83e8689edbaacd2f10c80de0dac67 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 788d1cd616c140df4072c6e0564c2995fbdc84ad */
+ * Stub hash: 779192c91fd281db6d2dc04143dd8656148ed789 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0)
@@ -92,3 +92,14 @@ static const zend_function_entry class_PDO_methods[] = {
        ZEND_ME(PDO, setAttribute, arginfo_class_PDO_setAttribute, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_PDO()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "PDO", class_PDO_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index aff847bbc444ad8619ce0ad719a42b0cbc665464..65edfd3329689f9947e0be1b7f732015860a19c9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 /** @return resource|false */
 function pg_connect(string $connection_string, int $flags = 0) {}
index 3d9a4f2d5d2b81d842b7122101e9e6bc00a28726..d5ebdbf29edf83df79723bf8350d09520dc6cd2e 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: de1718d3e6e66dfade25462b8461983b914120ed */
+ * Stub hash: c88ced859b9bc6775690361d932c4cec14cb0c64 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connect, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0)
@@ -652,3 +652,4 @@ static const zend_function_entry ext_functions[] = {
        ZEND_FE(pg_select, arginfo_pg_select)
        ZEND_FE_END
 };
+