|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-11 15:40 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 21:00:02 2025 UTC |
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); }