Re: How do I access a hash from an extention/module?
| From: | Markus Fischer | Date: | Thu, 06 Jun 2002 09:27:06 +0000 |
| Subject: | Re: How do I access a hash from an extention/module? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-84922@lists.php.net to get a copy of this message | ||
You can fech the zval * for _SESSION from the
EG(symbol_table), e.g. something like this (untested):
zval **z_sess;
if (zend_hash_find(&EG(symbol_table), "_SESSION", sizeof("_SESSION")-1,
(void**)&z_sess) == SUCCESS) {
...
}
Try something like
cd php4/ext
rgrep 'EG(symbol_table)' *
to get an idea how it's done.
- Markus
On Thu, Jun 06, 2002 at 11:14:32AM +0200, eric@terra.telemediair.nl wrote :
> I have posted this message before to the general list, but it seems
> nobody there can help me so I hope someone here might know...
>
> I am a bit stuck right now, I want to access the values of a global hash
> (actually it is a session variable) from within my PHP extention/module.
> So I want to be able to see which keys are defined in a hash, and what
> the corresponding value in this hash is for each key.
>
> Could someone please give me a small example how this is done? I have
> looked in the source code of the other extentions but I couldn't find
> anything that could be of any help (I might have missed it though).
>
> --
> #!perl # Life ain't fair, but root passwords help.
> # Eric Veldhuyzen eric@terra.telemediair.nl
> $!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~ # Perl Monger
> /.(.)...(.)(.)....(.)..(.)..(.)/;
$^$~$/$: $^$*$@$~
> $_>&$;
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
--
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
Did I help you? http://guru.josefine.at/wish_en
Konnte ich helfen? http://guru.josefine.at/wish_de