Bug #18283 Updated: Changing auto_append_file option within script is useless

From: Date: Thu, 11 Jul 2002 19:40:10 +0000
Subject: Bug #18283 Updated: Changing auto_append_file option within script is useless
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13875@lists.php.net to get a copy of this message
ID: 18283 Updated by: derick@php.net Reported By: jhorner@jhorner.com -Status: Open +Status: Won't fix Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.2.1 New Comment: You can just use "include" for this, so no need to add another hack ot this. I corrected the manual, which was wrong here. Derick Previous Comments: ------------------------------------------------------------------------ [2002-07-11 15:20:05] jhorner@jhorner.com According to the documentation of ini_set(), it is possible to change the auto_append_file option anywhere within a script. It would be nice to dynamically set the auto_append_file option from within a php script and have it executed when the primary script has completed. Although it's possible to change it using ini_set(), the scripting engine has already determined which prepend and append file to use even before calling the primary script. Line 1381 of PHP_SOURCE_DIR/main/main.c confirms this: retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS); Here's some pseudo-code to possibly fix this: retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 2, prepend_file_p, primary_file) == SUCCESS); if (PG(auto_append_file) && PG(auto_append_file)[0]) { append_file.filename = PG(auto_append_file); append_file.opened_path = NULL; append_file.free_filename = 0; append_file.type = ZEND_HANDLE_FILENAME; append_file_p = &append_file; retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, append_file_p) == SUCCESS); } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18283&edit=1

« previous php.bugs (#13875) next »