]> granicus.if.org Git - php/commitdiff
Intialization code is moved from request startup to module startup
authorDmitry Stogov <dmitry@php.net>
Fri, 10 Nov 2006 12:02:22 +0000 (12:02 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 10 Nov 2006 12:02:22 +0000 (12:02 +0000)
ext/bcmath/bcmath.c
ext/bcmath/php_bcmath.h

index 4e521fb506a00dc28b8ac7d347adf411a7803455..526e8572d631d10edf2c2e88e2200461343abea0 100644 (file)
@@ -33,6 +33,7 @@
 
 ZEND_DECLARE_MODULE_GLOBALS(bcmath);
 static PHP_GINIT_FUNCTION(bcmath);
+static PHP_GSHUTDOWN_FUNCTION(bcmath);
 
 /* {{{ arginfo */
 static
@@ -124,13 +125,13 @@ zend_module_entry bcmath_module_entry = {
        bcmath_functions,
        PHP_MINIT(bcmath),
        PHP_MSHUTDOWN(bcmath),
-       PHP_RINIT(bcmath),
-       PHP_RSHUTDOWN(bcmath),
+       NULL,
+       NULL,
        PHP_MINFO(bcmath),
        NO_VERSION_YET,
        PHP_MODULE_GLOBALS(bcmath),
        PHP_GINIT(bcmath),
-       NULL,
+    PHP_GSHUTDOWN(bcmath),
        NULL,
        STANDARD_MODULE_PROPERTIES_EX
 };
@@ -150,6 +151,17 @@ PHP_INI_END()
 static PHP_GINIT_FUNCTION(bcmath)
 {
        bcmath_globals->bc_precision = 0;
+       bc_init_numbers(TSRMLS_C);
+}
+/* }}} */
+
+/* {{{ PHP_GSHUTDOWN_FUNCTION
+ */
+static PHP_GSHUTDOWN_FUNCTION(bcmath)
+{
+       _bc_free_num_ex(&bcmath_globals->_zero_, 1);
+       _bc_free_num_ex(&bcmath_globals->_one_, 1);
+       _bc_free_num_ex(&bcmath_globals->_two_, 1);
 }
 /* }}} */
 
@@ -173,28 +185,6 @@ PHP_MSHUTDOWN_FUNCTION(bcmath)
 }
 /* }}} */
 
-/* {{{ PHP_RINIT_FUNCTION
- */
-PHP_RINIT_FUNCTION(bcmath)
-{
-       bc_init_numbers(TSRMLS_C);
-
-       return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(bcmath)
-{
-       _bc_free_num_ex(&BCG(_zero_), 1);
-       _bc_free_num_ex(&BCG(_one_), 1);
-       _bc_free_num_ex(&BCG(_two_), 1);
-
-       return SUCCESS;
-}
-/* }}} */      
-         
 /* {{{ PHP_MINFO_FUNCTION
  */
 PHP_MINFO_FUNCTION(bcmath)
index 2b6da6f123af47e6a104558ae06c51aefab9f050..1d1964a899a8c5baf18471acc9a60217bc7b06c5 100644 (file)
@@ -30,8 +30,6 @@ extern zend_module_entry bcmath_module_entry;
 
 PHP_MINIT_FUNCTION(bcmath);
 PHP_MSHUTDOWN_FUNCTION(bcmath);
-PHP_RINIT_FUNCTION(bcmath);
-PHP_RSHUTDOWN_FUNCTION(bcmath);
 PHP_MINFO_FUNCTION(bcmath);
 
 PHP_FUNCTION(bcadd);