]> granicus.if.org Git - php/commitdiff
Generate ext/intl class entries from stubs
authorMáté Kocsis <kocsismate@woohoolabs.com>
Fri, 5 Feb 2021 19:57:57 +0000 (20:57 +0100)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Tue, 9 Feb 2021 12:37:24 +0000 (13:37 +0100)
Closes GH-6670

44 files changed:
ext/intl/breakiterator/breakiterator.stub.php
ext/intl/breakiterator/breakiterator_arginfo.h
ext/intl/breakiterator/breakiterator_class.cpp
ext/intl/breakiterator/breakiterator_iterators.cpp
ext/intl/breakiterator/breakiterator_iterators.stub.php [new file with mode: 0644]
ext/intl/breakiterator/breakiterator_iterators_arginfo.h [new file with mode: 0644]
ext/intl/calendar/calendar.stub.php
ext/intl/calendar/calendar_arginfo.h
ext/intl/calendar/calendar_class.cpp
ext/intl/collator/collator.stub.php
ext/intl/collator/collator_arginfo.h
ext/intl/collator/collator_class.c
ext/intl/converter/converter.c
ext/intl/converter/converter.stub.php
ext/intl/converter/converter_arginfo.h
ext/intl/dateformat/dateformat.stub.php
ext/intl/dateformat/dateformat_arginfo.h
ext/intl/dateformat/dateformat_class.c
ext/intl/formatter/formatter.stub.php
ext/intl/formatter/formatter_arginfo.h
ext/intl/formatter/formatter_class.c
ext/intl/intl_error.c
ext/intl/intl_error.h
ext/intl/locale/locale.stub.php
ext/intl/locale/locale_arginfo.h
ext/intl/locale/locale_class.c
ext/intl/msgformat/msgformat.stub.php
ext/intl/msgformat/msgformat_arginfo.h
ext/intl/msgformat/msgformat_class.c
ext/intl/normalizer/normalizer.stub.php
ext/intl/normalizer/normalizer_arginfo.h
ext/intl/normalizer/normalizer_class.c
ext/intl/php_intl.c
ext/intl/php_intl.stub.php
ext/intl/php_intl_arginfo.h
ext/intl/spoofchecker/spoofchecker.stub.php
ext/intl/spoofchecker/spoofchecker_arginfo.h
ext/intl/spoofchecker/spoofchecker_class.c
ext/intl/timezone/timezone.stub.php
ext/intl/timezone/timezone_arginfo.h
ext/intl/timezone/timezone_class.cpp
ext/intl/uchar/uchar.c
ext/intl/uchar/uchar.stub.php
ext/intl/uchar/uchar_arginfo.h

index 35a57e44b90940e789ede2ba253ae1ad4089e929..bae4726be41601b390f82137e7e58e090f34ec83 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class IntlBreakIterator implements IteratorAggregate
 {
@@ -86,12 +86,6 @@ class IntlRuleBasedBreakIterator extends IntlBreakIterator
     public function getRuleStatusVec() {}
 }
 
-class IntlPartsIterator extends IntlIterator
-{
-    /** @return IntlBreakIterator */
-    public function getBreakIterator() {}
-}
-
 class IntlCodePointBreakIterator extends IntlBreakIterator
 {
     /** @return int */
index ec8c0c3ce702bfd9be11827ce13721fd3df49871..9e146ec24484287e1e2569d3db45e2730c75f539 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 6a121ed9817667820f05677a772781d6b788796b */
+ * Stub hash: 9e9dc1cd1302038f351f6075393494d1a58f0d74 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlBreakIterator_createCharacterInstance, 0, 0, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, locale, IS_STRING, 1, "null")
@@ -72,8 +72,6 @@ ZEND_END_ARG_INFO()
 
 #define arginfo_class_IntlRuleBasedBreakIterator_getRuleStatusVec arginfo_class_IntlBreakIterator_createCodePointInstance
 
-#define arginfo_class_IntlPartsIterator_getBreakIterator arginfo_class_IntlBreakIterator_createCodePointInstance
-
 #define arginfo_class_IntlCodePointBreakIterator_getLastCodePoint arginfo_class_IntlBreakIterator_createCodePointInstance
 
 
@@ -104,7 +102,6 @@ ZEND_METHOD(IntlRuleBasedBreakIterator, getBinaryRules);
 ZEND_METHOD(IntlRuleBasedBreakIterator, getRules);
 ZEND_METHOD(IntlRuleBasedBreakIterator, getRuleStatus);
 ZEND_METHOD(IntlRuleBasedBreakIterator, getRuleStatusVec);
-ZEND_METHOD(IntlPartsIterator, getBreakIterator);
 ZEND_METHOD(IntlCodePointBreakIterator, getLastCodePoint);
 
 
@@ -145,13 +142,39 @@ static const zend_function_entry class_IntlRuleBasedBreakIterator_methods[] = {
 };
 
 
-static const zend_function_entry class_IntlPartsIterator_methods[] = {
-       ZEND_ME(IntlPartsIterator, getBreakIterator, arginfo_class_IntlPartsIterator_getBreakIterator, ZEND_ACC_PUBLIC)
-       ZEND_FE_END
-};
-
-
 static const zend_function_entry class_IntlCodePointBreakIterator_methods[] = {
        ZEND_ME(IntlCodePointBreakIterator, getLastCodePoint, arginfo_class_IntlCodePointBreakIterator_getLastCodePoint, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_IntlBreakIterator(zend_class_entry *class_entry_IteratorAggregate)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlBreakIterator", class_IntlBreakIterator_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       zend_class_implements(class_entry, 1, class_entry_IteratorAggregate);
+
+       return class_entry;
+}
+
+zend_class_entry *register_class_IntlRuleBasedBreakIterator(zend_class_entry *class_entry_IntlBreakIterator)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlRuleBasedBreakIterator", class_IntlRuleBasedBreakIterator_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_IntlBreakIterator);
+
+       return class_entry;
+}
+
+zend_class_entry *register_class_IntlCodePointBreakIterator(zend_class_entry *class_entry_IntlBreakIterator)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlCodePointBreakIterator", class_IntlCodePointBreakIterator_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_IntlBreakIterator);
+
+       return class_entry;
+}
+
index 3f236db2d470ad6465d5d81a3a43883f19c0de33..aa9dd034932f4d26892ed536166d431b3e7f29dc 100644 (file)
@@ -220,13 +220,11 @@ static zend_object *BreakIterator_object_create(zend_class_entry *ce)
  */
 U_CFUNC void breakiterator_register_BreakIterator_class(void)
 {
-       zend_class_entry ce;
-
        /* Create and register 'BreakIterator' class. */
-       INIT_CLASS_ENTRY(ce, "IntlBreakIterator", class_IntlBreakIterator_methods);
-       ce.create_object = BreakIterator_object_create;
-       ce.get_iterator = _breakiterator_get_iterator;
-       BreakIterator_ce_ptr = zend_register_internal_class(&ce);
+
+       BreakIterator_ce_ptr = register_class_IntlBreakIterator(zend_ce_aggregate);
+       BreakIterator_ce_ptr->create_object = BreakIterator_object_create;
+       BreakIterator_ce_ptr->get_iterator = _breakiterator_get_iterator;
 
        memcpy(&BreakIterator_handlers, &std_object_handlers,
                sizeof BreakIterator_handlers);
@@ -236,8 +234,6 @@ U_CFUNC void breakiterator_register_BreakIterator_class(void)
        BreakIterator_handlers.get_debug_info = BreakIterator_get_debug_info;
        BreakIterator_handlers.free_obj = BreakIterator_objects_free;
 
-       zend_class_implements(BreakIterator_ce_ptr, 1, zend_ce_aggregate);
-
        zend_declare_class_constant_long(BreakIterator_ce_ptr,
                "DONE", sizeof("DONE") - 1, BreakIterator::DONE );
 
@@ -271,15 +267,9 @@ U_CFUNC void breakiterator_register_BreakIterator_class(void)
 
 
        /* Create and register 'RuleBasedBreakIterator' class. */
-       INIT_CLASS_ENTRY(ce, "IntlRuleBasedBreakIterator",
-                       class_IntlRuleBasedBreakIterator_methods);
-       RuleBasedBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce,
-                       BreakIterator_ce_ptr);
+       RuleBasedBreakIterator_ce_ptr = register_class_IntlRuleBasedBreakIterator(BreakIterator_ce_ptr);
 
        /* Create and register 'CodePointBreakIterator' class. */
-       INIT_CLASS_ENTRY(ce, "IntlCodePointBreakIterator",
-                       class_IntlCodePointBreakIterator_methods);
-       CodePointBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce,
-                       BreakIterator_ce_ptr);
+       CodePointBreakIterator_ce_ptr = register_class_IntlCodePointBreakIterator(BreakIterator_ce_ptr);
 }
 /* }}} */
index 7c955a5ecb2321b24dc0a88fe48744158499c511..4eb0fd8da99e8e1bae71e00c5731e0c489310885 100644 (file)
@@ -24,7 +24,7 @@
 extern "C" {
 #define USE_BREAKITERATOR_POINTER
 #include "breakiterator_class.h"
-#include "breakiterator_arginfo.h"
+#include "breakiterator_iterators_arginfo.h"
 #include "../intl_convert.h"
 #include "../locale/locale.h"
 #include <zend_exceptions.h>
@@ -287,12 +287,8 @@ U_CFUNC PHP_METHOD(IntlPartsIterator, getBreakIterator)
 
 U_CFUNC void breakiterator_register_IntlPartsIterator_class(void)
 {
-       zend_class_entry ce;
-
        /* Create and register 'BreakIterator' class. */
-       INIT_CLASS_ENTRY(ce, "IntlPartsIterator", class_IntlPartsIterator_methods);
-       IntlPartsIterator_ce_ptr = zend_register_internal_class_ex(&ce,
-                       IntlIterator_ce_ptr);
+       IntlPartsIterator_ce_ptr = register_class_IntlPartsIterator(IntlIterator_ce_ptr);
        IntlPartsIterator_ce_ptr->create_object = IntlPartsIterator_object_create;
 
        memcpy(&IntlPartsIterator_handlers, &IntlIterator_handlers,
diff --git a/ext/intl/breakiterator/breakiterator_iterators.stub.php b/ext/intl/breakiterator/breakiterator_iterators.stub.php
new file mode 100644 (file)
index 0000000..9a82640
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+/** @generate-class-entries */
+
+class IntlPartsIterator extends IntlIterator
+{
+    /** @return IntlBreakIterator */
+    public function getBreakIterator() {}
+}
diff --git a/ext/intl/breakiterator/breakiterator_iterators_arginfo.h b/ext/intl/breakiterator/breakiterator_iterators_arginfo.h
new file mode 100644 (file)
index 0000000..1d95e32
--- /dev/null
@@ -0,0 +1,25 @@
+/* This is a generated file, edit the .stub.php file instead.
+ * Stub hash: 5e165fe25d6d13824da9d7c5f0a089ee11626689 */
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlPartsIterator_getBreakIterator, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+
+ZEND_METHOD(IntlPartsIterator, getBreakIterator);
+
+
+static const zend_function_entry class_IntlPartsIterator_methods[] = {
+       ZEND_ME(IntlPartsIterator, getBreakIterator, arginfo_class_IntlPartsIterator_getBreakIterator, ZEND_ACC_PUBLIC)
+       ZEND_FE_END
+};
+
+zend_class_entry *register_class_IntlPartsIterator(zend_class_entry *class_entry_IntlIterator)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlPartsIterator", class_IntlPartsIterator_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_IntlIterator);
+
+       return class_entry;
+}
+
index 3da6ebb1d00e4c35671790c3de4dff8c5d2ef22a..68a2050c3ad30091b8c116b96d1900aba18c80fe 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class IntlCalendar
 {
index 8537836d5bd037fdcd750ce7ca9ef88fda9c846b..78bd855bdc7647f40696be03eb5450fe460b38cd 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 18a92d3af801f11e5c3b90e5d272fd98b3515c40 */
+ * Stub hash: a0800bd27fe214cce7420e689e9d7b519a7b6835 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar___construct, 0, 0, 0)
 ZEND_END_ARG_INFO()
@@ -270,3 +270,24 @@ static const zend_function_entry class_IntlGregorianCalendar_methods[] = {
        ZEND_ME_MAPPING(isLeapYear, intlgregcal_is_leap_year, arginfo_class_IntlGregorianCalendar_isLeapYear, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_IntlCalendar()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlCalendar", class_IntlCalendar_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
+zend_class_entry *register_class_IntlGregorianCalendar(zend_class_entry *class_entry_IntlCalendar)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", class_IntlGregorianCalendar_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_IntlCalendar);
+
+       return class_entry;
+}
+
index a46ef62e68756fb0b39353d214510d681345ac6a..8c1bdf3185be5c7a7bd6f2470d4abeb07165e9c5 100644 (file)
@@ -268,12 +268,9 @@ static zend_object *Calendar_object_create(zend_class_entry *ce)
  */
 void calendar_register_IntlCalendar_class(void)
 {
-       zend_class_entry ce;
-
        /* Create and register 'IntlCalendar' class. */
-       INIT_CLASS_ENTRY(ce, "IntlCalendar", class_IntlCalendar_methods);
-       ce.create_object = Calendar_object_create;
-       Calendar_ce_ptr = zend_register_internal_class(&ce);
+       Calendar_ce_ptr = register_class_IntlCalendar();
+       Calendar_ce_ptr->create_object = Calendar_object_create;
 
        memcpy( &Calendar_handlers, &std_object_handlers,
                sizeof Calendar_handlers);
@@ -331,8 +328,6 @@ void calendar_register_IntlCalendar_class(void)
        CALENDAR_DECL_LONG_CONST("WALLTIME_NEXT_VALID",                 UCAL_WALLTIME_NEXT_VALID);
 
        /* Create and register 'IntlGregorianCalendar' class. */
-       INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", class_IntlGregorianCalendar_methods);
-       GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce,
-               Calendar_ce_ptr);
+       GregorianCalendar_ce_ptr = register_class_IntlGregorianCalendar(Calendar_ce_ptr);
 }
 /* }}} */
index f42d1508cb965dae088824301ca00fcd2d5476bb..7a987a25aba1812c3ed06e47a0bd9f256e7285ba 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class Collator
 {
index 1b7dcc408f51aa1a00d47cac92656119297a364e..c9685a84f280649703676ef37d688d494165469f 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 869c6e60a8f2b153ef79f28a08e165ff3ec2bc14 */
+ * Stub hash: 9907156bf1d28af7bf6a1858dffc58994c12756f */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator___construct, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
@@ -85,3 +85,14 @@ static const zend_function_entry class_Collator_methods[] = {
        ZEND_ME_MAPPING(getSortKey, collator_get_sort_key, arginfo_class_Collator_getSortKey, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_Collator()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "Collator", class_Collator_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index 44452c147fa8b7230226f95bc2dc920ce3400705..7be73e8ea2695c59b1f44c9f4adc163d07a0743a 100644 (file)
@@ -63,12 +63,9 @@ zend_object *Collator_object_create(zend_class_entry *ce )
  */
 void collator_register_Collator_class( void )
 {
-       zend_class_entry ce;
-
        /* Create and register 'Collator' class. */
-       INIT_CLASS_ENTRY( ce, "Collator", class_Collator_methods );
-       ce.create_object = Collator_object_create;
-       Collator_ce_ptr = zend_register_internal_class( &ce );
+       Collator_ce_ptr = register_class_Collator();
+       Collator_ce_ptr->create_object = Collator_object_create;
 
        memcpy(&Collator_handlers, &std_object_handlers,
                sizeof Collator_handlers);
index 90971302ce287b03ca465288093f005d7116082f..7c4ac65262a1073209bd36865bd8469faa9ddc8f 100644 (file)
@@ -966,10 +966,7 @@ static zend_object *php_converter_clone_object(zend_object *object) {
 
 /* {{{ php_converter_minit */
 int php_converter_minit(INIT_FUNC_ARGS) {
-       zend_class_entry ce;
-
-       INIT_CLASS_ENTRY(ce, "UConverter", class_UConverter_methods);
-       php_converter_ce = zend_register_internal_class(&ce);
+       php_converter_ce = register_class_UConverter();
        php_converter_ce->create_object = php_converter_create_object;
        memcpy(&php_converter_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
        php_converter_object_handlers.offset = XtOffsetOf(php_converter_object, obj);
index 5b82b098f47f73dcb0eaebd0cb6cb85da30cd26c..8847bdcab02a0dc158d2d664950d38d88b76bc24 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class UConverter
 {
index 8b8f8fc1f521ea02db59049427a0397aedcf7a2f..60f6cab3d84eae482c007b362f7eff258ca84a89 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: e33e2614c969c59b79c6062f7a347a8e8e486d85 */
+ * Stub hash: c01b6c9d6a6754a2fffde1279bec3a984e6a2f34 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_UConverter___construct, 0, 0, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, destination_encoding, IS_STRING, 1, "null")
@@ -113,3 +113,14 @@ static const zend_function_entry class_UConverter_methods[] = {
        ZEND_ME(UConverter, transcode, arginfo_class_UConverter_transcode, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_UConverter()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "UConverter", class_UConverter_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index 22ece903c1e259b4d693591da214e9b8cb59e106..7ffaa1fe5ed7c741d36a7e00c46e63c3cafbf300 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class IntlDateFormatter
 {
index ff9fbfa6fd34850b3db083fc49e5c942bc36364e..65db5ecb95e6230f565dfe51f14561de5de0530a 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 62742b5f463272f43970e98900a89d513c4fb839 */
+ * Stub hash: 4f93c3fca18c225b26dec1e970b783baa4622425 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
        ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
@@ -125,3 +125,14 @@ static const zend_function_entry class_IntlDateFormatter_methods[] = {
        ZEND_ME_MAPPING(getErrorMessage, datefmt_get_error_message, arginfo_class_IntlDateFormatter_getErrorMessage, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_IntlDateFormatter()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlDateFormatter", class_IntlDateFormatter_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index 7d9dde20b056b5981829e9b69a0a33918b68110b..b6e02836770898808e3f087f63f92a3a285b285d 100644 (file)
@@ -107,12 +107,9 @@ zend_object *IntlDateFormatter_object_clone(zend_object *object)
  */
 void dateformat_register_IntlDateFormatter_class( void )
 {
-       zend_class_entry ce;
-
        /* Create and register 'IntlDateFormatter' class. */
-       INIT_CLASS_ENTRY( ce, "IntlDateFormatter", class_IntlDateFormatter_methods );
-       ce.create_object = IntlDateFormatter_object_create;
-       IntlDateFormatter_ce_ptr = zend_register_internal_class( &ce );
+       IntlDateFormatter_ce_ptr = register_class_IntlDateFormatter();
+       IntlDateFormatter_ce_ptr->create_object = IntlDateFormatter_object_create;
 
        memcpy(&IntlDateFormatter_handlers, &std_object_handlers,
                sizeof IntlDateFormatter_handlers);
index 045b0640ce72f0ebb1ee321b735c2320bc630d47..8118b19d4744f2cbd02a859804cde05163faf90c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class NumberFormatter
 {
index 79f977fb811f46e7186f813927e33d4225760e40..c30f2ad215cf8b995cc929fa85ec32aa8537c760 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 0f285bbaa6f4f37060eb8325956f41bd86e9dea3 */
+ * Stub hash: 2a232c97981e23bec14f03e564a7ec3d7fedc31e */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter___construct, 0, 0, 2)
        ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
@@ -111,3 +111,14 @@ static const zend_function_entry class_NumberFormatter_methods[] = {
        ZEND_ME_MAPPING(getErrorMessage, numfmt_get_error_message, arginfo_class_NumberFormatter_getErrorMessage, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_NumberFormatter()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "NumberFormatter", class_NumberFormatter_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index f7965ec7d11e503c2f7f7f252e6768d4a5975553..e2ff9989b6e72c11dc820db62994c36f98de38c0 100644 (file)
@@ -94,12 +94,9 @@ zend_object *NumberFormatter_object_clone(zend_object *object)
  */
 void formatter_register_class( void )
 {
-       zend_class_entry ce;
-
        /* Create and register 'NumberFormatter' class. */
-       INIT_CLASS_ENTRY( ce, "NumberFormatter", class_NumberFormatter_methods );
-       ce.create_object = NumberFormatter_object_create;
-       NumberFormatter_ce_ptr = zend_register_internal_class( &ce );
+       NumberFormatter_ce_ptr = register_class_NumberFormatter();
+       NumberFormatter_ce_ptr->create_object = NumberFormatter_object_create;
        NumberFormatter_ce_ptr->serialize = zend_class_serialize_deny;
        NumberFormatter_ce_ptr->unserialize = zend_class_unserialize_deny;
 
index 6babe701529fe230ff7fd6e6c872f5cd0e792ae8..64cf45ce6171e2ba6ff813c2b6fb664ad8515d5e 100644 (file)
@@ -203,17 +203,6 @@ void intl_errors_set_code( intl_error* err, UErrorCode err_code )
 }
 /* }}} */
 
-void intl_register_IntlException_class( void )
-{
-       zend_class_entry ce;
-
-       /* Create and register 'IntlException' class. */
-       INIT_CLASS_ENTRY_EX( ce, "IntlException", sizeof( "IntlException" ) - 1, NULL );
-       IntlException_ce_ptr = zend_register_internal_class_ex( &ce,
-               zend_ce_exception );
-       IntlException_ce_ptr->create_object = zend_ce_exception->create_object;
-}
-
 smart_str intl_parse_error_to_string( UParseError* pe )
 {
        smart_str    ret = {0};
index 927e5cdfd296e426c6c6ece2baed5a167732acef..bcf5d2cc4a2cee8728786407fec6e83ba80e5aab 100644 (file)
@@ -47,7 +47,4 @@ void        intl_errors_set( intl_error* err, UErrorCode code, const char* msg,
 // Other error helpers
 smart_str      intl_parse_error_to_string( UParseError* pe );
 
-// exported to be called on extension MINIT
-void           intl_register_IntlException_class( void );
-
 #endif // INTL_ERROR_H
index e5703293c025b8e5be64aa3b2c6587ecf6ba7de3..f20d2d3d97ae434d592b858eb1ea586cf75269ab 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class Locale
 {
index e95214636235329232a9bbdfdaf563a5c5b611b8..46c828f5198712285796e2c8a3ba1871a571acba 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 4135dc9df49d3fe20275d49bad428a2e3e0a8752 */
+ * Stub hash: 6b873a68045fb5cf75e23991a3c77aa01a8893ee */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Locale_getDefault, 0, 0, 0)
 ZEND_END_ARG_INFO()
@@ -98,3 +98,14 @@ static const zend_function_entry class_Locale_methods[] = {
        ZEND_ME_MAPPING(acceptFromHttp, locale_accept_from_http, arginfo_class_Locale_acceptFromHttp, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_Locale()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "Locale", class_Locale_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index 0670f556205b5f8817cae63471638fc70410a1fd..852988b4a646dab5676f998880c2f45b7433ad95 100644 (file)
@@ -30,19 +30,8 @@ zend_class_entry *Locale_ce_ptr = NULL;
  */
 void locale_register_Locale_class( void )
 {
-       zend_class_entry ce;
-
        /* Create and register 'Locale' class. */
-       INIT_CLASS_ENTRY( ce, "Locale", class_Locale_methods );
-       ce.create_object = NULL;
-       Locale_ce_ptr = zend_register_internal_class( &ce );
-
-       /* Declare 'Locale' class properties. */
-       if( !Locale_ce_ptr )
-       {
-               zend_error( E_ERROR,
-                       "Locale: Failed to register Locale class.");
-               return;
-       }
+       Locale_ce_ptr = register_class_Locale();
+       Locale_ce_ptr->create_object = NULL;
 }
 /* }}} */
index a9a3e3e181bb9fcb46c902d655383826d2a90cd4..f46e663203bcc43065e48f834c11b428418ddd65 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class MessageFormatter
 {
index 3bad9aa4984930eba83ea5edf9f39e5ff75726a9..958f7dd8eaffda247fd9eb9265d1fd491416cb3b 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: ece8c5157dc3a62ca2951d058b3c5497bb5cb836 */
+ * Stub hash: 0d5b34913965434a4015e2b6ac7288edbbafc3f3 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MessageFormatter___construct, 0, 0, 2)
        ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
@@ -69,3 +69,14 @@ static const zend_function_entry class_MessageFormatter_methods[] = {
        ZEND_ME_MAPPING(getErrorMessage, msgfmt_get_error_message, arginfo_class_MessageFormatter_getErrorMessage, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_MessageFormatter()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "MessageFormatter", class_MessageFormatter_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index d8bf9a006c0500db088b68d259bbfff09963a070..d8274a1440fbcd0aad20980ea5ce5931362cef29 100644 (file)
@@ -93,12 +93,9 @@ zend_object *MessageFormatter_object_clone(zend_object *object)
  */
 void msgformat_register_class( void )
 {
-       zend_class_entry ce;
-
        /* Create and register 'MessageFormatter' class. */
-       INIT_CLASS_ENTRY( ce, "MessageFormatter", class_MessageFormatter_methods );
-       ce.create_object = MessageFormatter_object_create;
-       MessageFormatter_ce_ptr = zend_register_internal_class( &ce );
+       MessageFormatter_ce_ptr = register_class_MessageFormatter();
+       MessageFormatter_ce_ptr->create_object = MessageFormatter_object_create;
 
        memcpy(&MessageFormatter_handlers, &std_object_handlers,
                sizeof MessageFormatter_handlers);
index 243ace532d1cc0c6b73025efce40e57ff653a675..0c9e1785dc5f9739450feb6951f8326c548372c3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class Normalizer
 {
index cd5a41de60883cb9cf875739c7f1289c43c075b7..efd94ead6bffe07a1b6756ebd97d692466a10e1e 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 3b9ef4888cc32bd009fb87db52859953902454fc */
+ * Stub hash: 651065249a99f9ee50126d58223b8f4527e3fc09 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Normalizer_normalize, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
@@ -31,3 +31,14 @@ static const zend_function_entry class_Normalizer_methods[] = {
 #endif
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_Normalizer()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "Normalizer", class_Normalizer_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index 7a46acb0b29f46d90b7ac958fba83eabb3be9a21..29299da206742732fc7790aa016d0b1578c80e6f 100644 (file)
@@ -30,20 +30,8 @@ zend_class_entry *Normalizer_ce_ptr = NULL;
  */
 void normalizer_register_Normalizer_class( void )
 {
-       zend_class_entry ce;
-
        /* Create and register 'Normalizer' class. */
-       INIT_CLASS_ENTRY( ce, "Normalizer", class_Normalizer_methods );
-       ce.create_object = NULL;
-       Normalizer_ce_ptr = zend_register_internal_class( &ce );
-
-       /* Declare 'Normalizer' class properties. */
-       if( !Normalizer_ce_ptr )
-       {
-               zend_error( E_ERROR,
-                       "Normalizer: attempt to create properties "
-                       "on a non-registered class." );
-               return;
-       }
+       Normalizer_ce_ptr = register_class_Normalizer();
+       Normalizer_ce_ptr->create_object = NULL;
 }
 /* }}} */
index 2b91266e7ed656c4013035ea6b07085f9599c457..01361ed262a4e962e9b75139be0f275b5a63edf0 100644 (file)
@@ -215,7 +215,8 @@ PHP_MINIT_FUNCTION( intl )
        spoofchecker_register_constants( INIT_FUNC_ARGS_PASSTHRU );
 
        /* Register 'IntlException' PHP class */
-       intl_register_IntlException_class(  );
+       IntlException_ce_ptr = register_class_IntlException(zend_ce_exception);
+       IntlException_ce_ptr->create_object = zend_ce_exception->create_object;
 
        /* Register 'IntlIterator' PHP class */
        intl_register_IntlIterator_class(  );
@@ -224,7 +225,7 @@ PHP_MINIT_FUNCTION( intl )
        breakiterator_register_BreakIterator_class(  );
 
        /* Register 'IntlPartsIterator' class */
-       breakiterator_register_IntlPartsIterator_class(  );
+       breakiterator_register_IntlPartsIterator_class();
 
        /* Global error handling. */
        intl_error_init( NULL );
index 26b7922c2c702fc09a622ca272aa0d709c66bab6..70bb606da4a0dae7962a5f78474b3ea7341d5b1a 100644 (file)
@@ -1,6 +1,10 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
+
+class IntlException extends Exception
+{
+}
 
 /* calendar */
 
index 57299b841fb7a80aa54b0e342554bc808c535a81..6d52b53b5738acbf762d80799443459e6953e383 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: c890e3cde79ffeade4623001cc369aa734812959 */
+ * Stub hash: 9ddf3e4e42735c34a8b53a1856d6dc93346afc6f */
 
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
        ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
@@ -1165,3 +1165,19 @@ static const zend_function_entry ext_functions[] = {
        ZEND_FE(transliterator_get_error_message, arginfo_transliterator_get_error_message)
        ZEND_FE_END
 };
+
+
+static const zend_function_entry class_IntlException_methods[] = {
+       ZEND_FE_END
+};
+
+zend_class_entry *register_class_IntlException(zend_class_entry *class_entry_Exception)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlException", class_IntlException_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception);
+
+       return class_entry;
+}
+
index 4fdd49473c5de975aca8b6044cc6cb2419c047d6..a1e49480456fcc2c086ac7be6f579c787465daaf 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class Spoofchecker
 {
index 6079794fdfe7e190c8cbc592566230bf18d9ba9c..a0e7c91d4d28f970d557bad2e1ce4e39202b25a0 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 10c330c8e06dbe21833f9c556b005fde2ea0ab42 */
+ * Stub hash: b0317673c829b873b95aac34d362cd5ad004aca9 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker___construct, 0, 0, 0)
 ZEND_END_ARG_INFO()
@@ -51,3 +51,14 @@ static const zend_function_entry class_Spoofchecker_methods[] = {
 #endif
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_Spoofchecker()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "Spoofchecker", class_Spoofchecker_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index e1c8dc63a16a87dd033862bfdac718f70218ccba..bbb341cda4e3a8f8a9cc7abcd6a82c2fb800014f 100644 (file)
@@ -90,12 +90,9 @@ static zend_object *spoofchecker_clone_obj(zend_object *object) /* {{{ */
  */
 void spoofchecker_register_Spoofchecker_class(void)
 {
-       zend_class_entry ce;
-
        /* Create and register 'Spoofchecker' class. */
-       INIT_CLASS_ENTRY(ce, "Spoofchecker", class_Spoofchecker_methods);
-       ce.create_object = Spoofchecker_object_create;
-       Spoofchecker_ce_ptr = zend_register_internal_class(&ce);
+       Spoofchecker_ce_ptr = register_class_Spoofchecker();
+       Spoofchecker_ce_ptr->create_object = Spoofchecker_object_create;
 
        memcpy(&Spoofchecker_handlers, &std_object_handlers,
                sizeof Spoofchecker_handlers);
index 60ec7524a60a3595276cca604d20d73ef653a3c4..e8d46bde8709ba40e5da89749edbcffcd5f4788f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class IntlTimeZone
 {
index f59fd9024b81a8541b5b13bb4dce69820fee96fa..d828675b4772f36a305c196e02cd8d68ae3f9500 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: afd0e74b29d54cde9789787b924af9b43539a7f4 */
+ * Stub hash: 02045a0de09413796dd1ca7495b0b1beff14a074 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlTimeZone___construct, 0, 0, 0)
 ZEND_END_ARG_INFO()
@@ -152,3 +152,14 @@ static const zend_function_entry class_IntlTimeZone_methods[] = {
        ZEND_ME_MAPPING(useDaylightTime, intltz_use_daylight_time, arginfo_class_IntlTimeZone_useDaylightTime, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_IntlTimeZone()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlTimeZone", class_IntlTimeZone_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
index f5749fd621de8ce716bdb693988128550ca6bf5f..13e691ad9710099f521e56c9d1e5ee9ef8f4ca9d 100644 (file)
@@ -396,18 +396,9 @@ static zend_object *TimeZone_object_create(zend_class_entry *ce)
  */
 U_CFUNC void timezone_register_IntlTimeZone_class(void)
 {
-       zend_class_entry ce;
-
        /* Create and register 'IntlTimeZone' class. */
-       INIT_CLASS_ENTRY(ce, "IntlTimeZone", class_IntlTimeZone_methods);
-       ce.create_object = TimeZone_object_create;
-       TimeZone_ce_ptr = zend_register_internal_class(&ce);
-       if (!TimeZone_ce_ptr) {
-               //can't happen now without bigger problems before
-               php_error_docref(NULL, E_ERROR,
-                       "IntlTimeZone: class registration has failed.");
-               return;
-       }
+       TimeZone_ce_ptr = register_class_IntlTimeZone();
+       TimeZone_ce_ptr->create_object = TimeZone_object_create;
 
        memcpy(&TimeZone_handlers, &std_object_handlers,
                sizeof TimeZone_handlers);
index 0f44b454b44991408c5f9632533fd6833100c349..ee9000754688324595cb83d4ca9d4f3a2ba83075 100644 (file)
@@ -612,10 +612,9 @@ IC_CHAR_METHOD_CHAR(getBidiPairedBracket)
 /* }}} */
 
 int php_uchar_minit(INIT_FUNC_ARGS) {
-       zend_class_entry tmp, *ce;
+       zend_class_entry *ce;
 
-       INIT_CLASS_ENTRY(tmp, "IntlChar", class_IntlChar_methods);
-       ce = zend_register_internal_class(&tmp);
+       ce = register_class_IntlChar();
 
 #define IC_CONSTL(name, val) \
        zend_declare_class_constant_long(ce, name, strlen(name), val);
index f3ebd78bcb75cf954f01df26ce67701d5ba0ab81..2bb667e44e561e306aeebc744527cbd0d7fb7d55 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class IntlChar
 {
index c4e22cd7677845e2c21da5a02e589edae9eeec20..0780fcee6cb869fd20db6e7d29cbd31fa514b60e 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 05ea5d884642e75721f90728fb24b7ad5ce46897 */
+ * Stub hash: 65836ce6bd16316bb022bc75ce5e2fbbdd1880b7 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_hasBinaryProperty, 0, 0, 2)
        ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL)
@@ -295,3 +295,14 @@ static const zend_function_entry class_IntlChar_methods[] = {
        ZEND_ME(IntlChar, toupper, arginfo_class_IntlChar_toupper, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
        ZEND_FE_END
 };
+
+zend_class_entry *register_class_IntlChar()
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "IntlChar", class_IntlChar_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+