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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Fri Dec 27 09:01:29 2024 UTC