Browse Source

refactor mshutdown minit

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@992 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 9 years ago
parent
commit
619a40cb85
  1. 6
      submodules/xc_coverager.c
  2. 4
      submodules/xc_coverager.h
  3. 8
      xcache.c
  4. 7
      xcache/xc_sandbox.c
  5. 3
      xcache/xc_sandbox.h
  6. 3
      xcache/xc_utils.h

6
submodules/xc_coverager.c

@ -468,8 +468,8 @@ void xc_coverager_handle_ext_stmt(zend_op_array *op_array, zend_uchar op) /* {{{
}
/* }}} */
/* init/destroy */
int xc_coverager_init(int module_number TSRMLS_DC) /* {{{ */
/* MINIT/MSHUTDOWN */
int xc_coverager_module_init(int module_number TSRMLS_DC) /* {{{ */
{
old_compile_file = zend_compile_file;
zend_compile_file = xc_compile_file_for_coverage;
@ -492,7 +492,7 @@ int xc_coverager_init(int module_number TSRMLS_DC) /* {{{ */
return SUCCESS;
}
/* }}} */
void xc_coverager_destroy() /* {{{ */
void xc_coverager_module_shutdown() /* {{{ */
{
if (old_compile_file == xc_compile_file_for_coverage) {
zend_compile_file = old_compile_file;

4
submodules/xc_coverager.h

@ -2,8 +2,8 @@
#include "xcache.h"
void xc_coverager_handle_ext_stmt(zend_op_array *op_array, zend_uchar op);
int xc_coverager_init(int module_number TSRMLS_DC);
void xc_coverager_destroy();
int xc_coverager_module_init(int module_number TSRMLS_DC);
void xc_coverager_module_shutdown();
void xc_coverager_request_init(TSRMLS_D);
void xc_coverager_request_shutdown(TSRMLS_D);
PHP_FUNCTION(xcache_coverager_decode);

8
xcache.c

@ -3939,9 +3939,9 @@ static PHP_MINIT_FUNCTION(xcache)
#endif
}
xc_util_init(module_number TSRMLS_CC);
xc_sandbox_module_init(module_number TSRMLS_CC);
#ifdef HAVE_XCACHE_COVERAGER
xc_coverager_init(module_number TSRMLS_CC);
xc_coverager_module_init(module_number TSRMLS_CC);
#endif
return SUCCESS;
@ -3954,9 +3954,9 @@ err_init:
static PHP_MSHUTDOWN_FUNCTION(xcache)
{
#ifdef HAVE_XCACHE_COVERAGER
xc_coverager_destroy();
xc_coverager_module_shutdown();
#endif
xc_util_destroy();
xc_sandbox_module_shutdown();
if (xc_initized) {
xc_destroy();

7
xcache/xc_sandbox.c

@ -433,8 +433,8 @@ zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D) /* {{{ */
/* }}} */
#endif
/* init/destroy */
int xc_util_init(int module_number TSRMLS_DC) /* {{{ */
/* MINIT/MSHUTDOWN */
int xc_sandbox_module_init(int module_number TSRMLS_DC) /* {{{ */
{
#ifdef XCACHE_ERROR_CACHING
old_zend_error_cb = zend_error_cb;
@ -444,7 +444,7 @@ int xc_util_init(int module_number TSRMLS_DC) /* {{{ */
return SUCCESS;
}
/* }}} */
void xc_util_destroy() /* {{{ */
void xc_sandbox_module_shutdown() /* {{{ */
{
#ifdef XCACHE_ERROR_CACHING
if (zend_error_cb == xc_sandbox_error_cb) {
@ -453,4 +453,3 @@ void xc_util_destroy() /* {{{ */
#endif
}
/* }}} */

3
xcache/xc_sandbox.h

@ -8,6 +8,9 @@
/* Purpose: run specified function in compiler sandbox, restore everything to previous state after it returns
*/
int xc_sandbox_module_init(int module_number TSRMLS_DC);
void xc_sandbox_module_shutdown();
/* return op_array to install */
typedef zend_op_array *(*xc_sandboxed_func_t)(void *data TSRMLS_DC);
zend_op_array *xc_sandbox(xc_sandboxed_func_t sandboxed_func, void *data, ZEND_24(NOTHING, const) char *filename TSRMLS_DC);

3
xcache/xc_utils.h

@ -1,9 +1,6 @@
#include "php.h"
#include "xcache.h"
int xc_util_init(int module_number TSRMLS_DC);
void xc_util_destroy();
typedef struct {
zend_op_array *op_array;
HashTable *function_table;

Loading…
Cancel
Save