Re: How to get script filename in module RINIT function
| From: | Bostjan Skufca | Date: | Thu, 12 Aug 2010 17:38:20 +0000 |
| Subject: | Re: How to get script filename in module RINIT function | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49430@lists.php.net to get a copy of this message | ||
Yes, that did it! I was wondering what those SG and EGs are :)
Anyway, the EG(included_files) would not work, because hash values (file
paths) are not stored, only keys. Snippet from Zend/zend.h
...
zend_hash_add(&EG(included_files), file_handle->opened_path,
strlen(file_handle->opened_path)+1, (void *)&dummy, sizeof(int), NULL);
...
Again, thank you all!
b.
On 10 August 2010 19:57, Chris Stockton <chrisstocktonaz@gmail.com> wrote:
> Hello,
>
> I would check the running sapi and use the sapi specific approach. This is
> cheap performance wise. I.e. SG(request_info).path_translated for Apache I
> believe and cli example you can Prolly find in the cli sapi source. I see
> argv being a good place maybe.
>
> On Aug 10, 2010 9:44 AM, "Bostjan Skufca" <bostjan@a2o.si> wrote:
> 2010/8/10 Johannes Schlüter <johannes@schlueters.de>
>
>
> > Hi,
> >
> > On Tue, 2010-08-10 at 17:24 +0200, Bostjan Skufca wrote:
> > > I've been digging a little d...
> So simple thing, so easy to overlook...
> But I believe it is fairly easy to check if autoprepend is enabled and use
> second item from the list in that case, or (in case that is not posible)
> introduce new ini setting for that matter.
>
>
>
> > char *hentry;
> > > zend_hash_internal_pointer_reset(&EG(included_files));
> > > zend_ha...
> Aaaa, again, so simple. I feel such a newbie, but obviously not without a
> reason :)
>
>
>
> But thinking about this idea I had another idea: Use the userland
> > stacktrace. While this won't w...
> This would probably mean I have to modify PHP itself or call certain
> extension function from within PHP script?
> (That is what I am desperately trying to avoid.)
>
>
> Again, thanks for all the help!
> b.
>
>