It looks like you're trying to access a variable of a class, not an instance 
of that class. try something more like

$authObj = new Auth;
$session = &Auth::_importGlobalVariable("session");
$session[$authObj->_sessionName]['registered'] = true;

I'm pretty sure php4 doesn't allow access to variables with the :: operator. I 
sincerely doubt php5 does (although i suppose logically it could be used to 
access static variables...?)

Does your class extend Auth? if so you should use $this-> instead of 
instantiating a new object... I'm honestly not sure what you're trying to do 
here... Even if your class extends Auth, i don't see how changing $session 
would do you any good since it appears to be applicable only to whatever 
function you took that snippet from, not the entire object (which would look 
like $this->session instead of $session)

If you post a more thorough description of what you're trying to do, and 
explain the OOP relationships a bit more, that would help....

-Evan


On Wednesday 03 September 2003 10:08 pm, jsWalter wrote:
> I have a parent Class that does this in one of it's methods...
>
>
>         $session = &Auth::_importGlobalVariable("session");
>         $session[$this->_sessionName]['registered'] = true;
>
> I would like to "hook" into this in on eof my methods in a child class
>
> I thought I could do this...
>
> [538]   $session = Auth::_importGlobalVariable("session");
> [539]   $session[Auth::_sessionName]['registered'] = true;
>
> But I get this error:
>
>     Parse error: parse error, unexpected ']', expecting '(' in
>     mypath\AuthUser.php on line 539
>
> OK, I guessed wrong (again).
>
> This is how PEAR::Auth deals with inserting its class vars into a session
> and I want to piggyback on that. No need to roll my own, I think.
>
> Can someone show me the errors of my ways?
>
> Thanks
>
> Walter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to