<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                我們知道每一個擴展都有一個zend_module_entry結構,在這個結構中,我們可以定義幾個鉤子函數,分別對應php的生命周期階段 ```c /* {{{ hello_module_entry */ zend_module_entry hello_module_entry = { STANDARD_MODULE_HEADER, // 宏統一設置 "hello", // 擴展名稱 hello_functions, PHP_MINIT(hello), PHP_MSHUTDOWN(hello), PHP_RINIT(hello), /* Replace with NULL if there's nothing to do at request start */ PHP_RSHUTDOWN(hello), /* Replace with NULL if there's nothing to do at request end */ PHP_MINFO(hello), PHP_HELLO_VERSION, STANDARD_MODULE_PROPERTIES // 宏統一設置 }; /* }}} */ ``` 通過PHP_MINIT,PHP_MSHUTDOWN,PHP_RINIT,PHP_RSHUTDOWN可以獲得鉤子函數的地址,zend_module_entry的幾個鉤子函數對應展開如下: ```c PHP_MINIT(hello), // 展開后zm_startup_hello PHP_MSHUTDOWN(hello), // 展開后zm_shutdown_hello PHP_RINIT(hello), // 展開后zm_activate_hello PHP_RSHUTDOWN(hello), // 展開后zm_deactivate_hello ``` ### 具體鉤子函數實現: #### 模塊初始化 可以注冊類,常量,并且可以覆蓋php編譯和執行,從而接管php的編譯和執行 ```c // hello.c PHP_MINIT_FUNCTION(hello) { /* If you have INI entries, uncomment these lines REGISTER_INI_ENTRIES(); */ return SUCCESS; } ``` 展開后 ```c int zm_startup_hello(int type, int module_number) { /* If you have INI entries, uncomment these lines REGISTER_INI_ENTRIES(); */ return SUCCESS; } ``` 模塊關閉 ```c // hello.c PHP_MSHUTDOWN_FUNCTION(hello) { /* uncomment this line if you have INI entries UNREGISTER_INI_ENTRIES(); */ return SUCCESS; } ``` 展開后 ```c int zm_shutdown_hello(int type, int module_number) { /* If you have INI entries, uncomment these lines UNREGISTER_INI_ENTRIES(); */ return SUCCESS; } ``` #### 請求初始化 在請求之前被調用 ```c PHP_RINIT_FUNCTION(hello) { #if defined(COMPILE_DL_HELLO) && defined(ZTS) ZEND_TSRMLS_CACHE_UPDATE(); #endif return SUCCESS; } ``` 展開后: ```c int zm_activate_hello(int type, int module_number) { #if defined(COMPILE_DL_HELLO) && defined(ZTS) ZEND_TSRMLS_CACHE_UPDATE(); #endif return SUCCESS; } ``` #### 請求結束 在請求結束后被調用 ```c PHP_RSHUTDOWN_FUNCTION(hello) { return SUCCESS; } ``` 展開后: ```c int zm_deactivate_hello(int type, int module_number) { return SUCCESS; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看