10 #include "ext/standard/info.h"
15 #include "validator.h"
18 ZEND_DECLARE_MODULE_GLOBALS(psi
);
21 STD_PHP_INI_ENTRY("psi.directory", "psis", PHP_INI_ALL
, OnUpdateString
, directory
, zend_psi_globals
, psi_globals
)
24 void psi_error(int type
, const char *msg
, ...)
30 vslprintf(buf
, 0x1000, msg
, argv
);
36 PHP_MINIT_FUNCTION(psi
)
38 REGISTER_INI_ENTRIES();
40 PSI_ContextInit(&PSI_G(context
), PSI_Libjit(), psi_error
);
41 PSI_ContextBuild(&PSI_G(context
), PSI_G(directory
));
45 PHP_MSHUTDOWN_FUNCTION(psi
)
47 jit_context_t ctx
= PSI_G(context
);
48 jit_context_destroy(ctx
);
50 UNREGISTER_INI_ENTRIES();
55 /* Remove if there's nothing to do at request start */
56 /* {{{ PHP_RINIT_FUNCTION
58 PHP_RINIT_FUNCTION(psi
)
60 #if defined(COMPILE_DL_PSI) && defined(ZTS)
61 ZEND_TSRMLS_CACHE_UPDATE();
67 /* Remove if there's nothing to do at request end */
68 /* {{{ PHP_RSHUTDOWN_FUNCTION
70 PHP_RSHUTDOWN_FUNCTION(psi
)
76 PHP_MINFO_FUNCTION(psi
)
78 php_info_print_table_start();
79 php_info_print_table_header(2, "psi support", "enabled");
80 php_info_print_table_end();
82 DISPLAY_INI_ENTRIES();
84 const zend_function_entry psi_functions
[] = {
88 zend_module_entry psi_module_entry
= {
89 STANDARD_MODULE_HEADER
,
94 PHP_RINIT(psi
), /* Replace with NULL if there's nothing to do at request start */
95 PHP_RSHUTDOWN(psi
), /* Replace with NULL if there's nothing to do at request end */
98 STANDARD_MODULE_PROPERTIES
101 #ifdef COMPILE_DL_PSI
103 ZEND_TSRMLS_CACHE_DEFINE();
113 * vim600: noet sw=4 ts=4 fdm=marker
114 * vim<600: noet sw=4 ts=4