php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #18283 Changing auto_append_file option within script is useless
Submitted: 2002-07-11 15:20 UTC Modified: 2002-07-11 15:40 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jhorner at jhorner dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.2.1 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jhorner at jhorner dot com
New email:
PHP Version: OS:

 

 [2002-07-11 15:20 UTC] jhorner at jhorner dot 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);
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-11 15:40 UTC] derick@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 18:01:31 2024 UTC