summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-05-02 20:11:22 +0000
committerFelipe Pena <felipe@php.net>2010-05-02 20:11:22 +0000
commit151fc3b7c04d9192a5f0c1d015b9cd63afe92f61 (patch)
tree78dcd4aa753ca01ff8368affea2ef5fd344a6a18
parent90c336026eabac357d5479138ff54c7c23b7fca7 (diff)
downloadphp-git-151fc3b7c04d9192a5f0c1d015b9cd63afe92f61.tar.gz
- Revert accidental changes
-rw-r--r--ext/standard/file.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 0c53689582..58c111253e 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -136,12 +136,26 @@ php_file_globals file_globals;
/* {{{ ZTS-stuff / Globals / Prototypes */
+/* sharing globals is *evil* */
+static int le_stream_context = FAILURE;
+PHPAPI int php_le_stream_context(void)
+{
+ return le_stream_context;
+}
/* }}} */
/* {{{ Module-Stuff
*/
-
+static ZEND_RSRC_DTOR_FUNC(file_context_dtor)
+{
+ php_stream_context *context = (php_stream_context*)rsrc->ptr;
+ if (context->options) {
+ zval_ptr_dtor(&context->options);
+ context->options = NULL;
+ }
+ php_stream_context_free(context);
+}
static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC)
{
@@ -162,6 +176,7 @@ PHP_INI_END()
PHP_MINIT_FUNCTION(file)
{
+ le_stream_context = zend_register_list_destructors_ex(file_context_dtor, NULL, "stream-context", module_number);
#ifdef ZTS
ts_allocate_id(&file_globals_id, sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor);