From: Ilia Alshanetsky Date: Mon, 30 Dec 2002 23:45:18 +0000 (+0000) Subject: Fixed bug #21045 (Apache 2 SAPI now supports the mod_php_memory_usage X-Git-Tag: PHP_5_0_dev_before_13561_fix~555 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f6bc82de797537f6d8b1db96497dd3d7d556f9a;p=php Fixed bug #21045 (Apache 2 SAPI now supports the mod_php_memory_usage log variable that allows users to log the memory usage of their PHP scripts). --- diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index a999369df5..48221cd46a 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -498,6 +498,15 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) zfd.opened_path = NULL; php_execute_script(&zfd TSRMLS_CC); +#ifdef MEMORY_LIMIT + { + char *mem_usage; + + mem_usage = apr_psprintf(ctx->r->pool, "%u", AG(allocated_memory_peak)); + AG(allocated_memory_peak) = 0; + apr_table_set(ctx->r->notes, "mod_php_memory_usage", mem_usage); + } +#endif } else { zend_syntax_highlighter_ini syntax_highlighter_ini;