Last active
December 16, 2015 15:49
-
-
Save rsky/5458167 to your computer and use it in GitHub Desktop.
no globals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHP_ARG_ENABLE(noglobals, for noglobals support, | |
[ --enable-noglobals Include noglobals support], | |
yes, yes) | |
PHP_NEW_EXTENSION(noglobals, noglobals.c, $ext_shared) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef HAVE_CONFIG_H | |
#include "config.h" | |
#endif | |
#include <php.h> | |
#define NOGLOBALS_VERSION "0.0.1-dev" | |
#define DELETE_AUTO_GLOBALS(name) zend_hash_del(CG(auto_globals), name, sizeof(name)) | |
static PHP_MINIT_FUNCTION(noglobals); | |
static PHP_RINIT_FUNCTION(noglobals); | |
static PHP_MINFO_FUNCTION(noglobals); | |
static zend_function_entry noglobals_functions[] = { | |
PHP_FE_END | |
}; | |
static zend_module_entry noglobals_module_entry = { | |
STANDARD_MODULE_HEADER, | |
"noglobals", | |
noglobals_functions, | |
PHP_MINIT(noglobals), | |
NULL, | |
PHP_RINIT(noglobals), | |
NULL, | |
PHP_MINFO(noglobals), | |
NOGLOBALS_VERSION, | |
STANDARD_MODULE_PROPERTIES | |
}; | |
#ifdef COMPILE_DL_NOGLOBALS | |
ZEND_GET_MODULE(noglobals) | |
#endif | |
static PHP_MINIT_FUNCTION(noglobals) | |
{ | |
return SUCCESS; | |
} | |
static PHP_RINIT_FUNCTION(noglobals) | |
{ | |
DELETE_AUTO_GLOBALS("GLOBALS"); | |
DELETE_AUTO_GLOBALS("_REQUEST"); | |
return SUCCESS; | |
} | |
static PHP_MINFO_FUNCTION(noglobals) | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment