Re: [PATCH] #29416 - ob_include
| From: | Stuart Dallas | Date: | Thu, 02 Sep 2004 19:44:26 +0000 |
| Subject: | Re: [PATCH] #29416 - ob_include | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-12550@lists.php.net to get a copy of this message | ||
On Wed, 1 Sep 2004 16:15:59 -0700, Sara Golemon <pollita@php.net> wrote:
> > This is my first attempt at submitting a patch so please be gentle :).
> >
> *sharpens fangs*
Oops, asked for that!
> > The feature requested in #29416 is something I've wanted to see for a
> > while, so I decided to have a go at adding it.
> >
> Considering the triviality of doing it in user space (the bug report shows
> the four lines it'd take) and the potential for changes in how ZE compiles
> and executes a new function, I'll throw a -1 vote at it.
>
> > I decided name ob_include described the method by which the function
> > did it's job rather than what it was for. I have implemented it as
> > eval_file_get_output which I feel is a better description of its
> > purpose. The requester suggests require and _once variations but those
> > make little sense to me so I haven't implemented those.
> >
> > Index: ext/standard/basic_functions.c
> >
> There's a considerable amount of work you're not doing here in terms of
> managing variable scope and dealing with the return value (you'll notice
> some particular weirdness if you use this from within a function).
>
> Take a look at (PHP5)Zend/zend_execute.c::zend_include_or_eval_handler() or
> (PHP4)Zend/zend_execute.c::execute() (the potion involving `case
> ZEND_INCLUDE_OR_EVAL:`)
To be honest I wasn't really expecting much more. I made a patch that
did what I wanted (I don't need it in a function... yet) and thought
I'l throw it out there.
In case anyone cares I've put it up here:
http://dev.stut.net/php/eval_file_get_output.patch
I appreciate your comments and those from Derick.
--
Stuart