[horde] Using hooks to permanently set from_addr and fullname

Chuck Hagenbuch chuck at horde.org
Fri Jul 22 20:10:00 PDT 2005


Quoting Kevin Myer <kevin_myer at iu13.org>:

>> Are you sure this is from preferences hooks? The check on line 707 of
>> Prefs.php:
>>
>>        if (!is_null($this->_hooksCalled) && !Auth::getAuth()) {
>>            return;
>>        }
>>
>> ... looks suspicious to me - should that be && Auth::getAuth(), instead
>> of ! ? Anyone?
>
> Ok, from a calltrace of an import of a single event into a calendar, 
> that is the critical point that is generating all the directory 
> server connections.  I
> changed !Auth::getAuth() to Auth::getAuth() and no extra connections were
> created.  I'm importing a 200Kb event file now, which normally

Michael, you introduced the !Auth::getAuth() in rev. 1.88 of Prefs.php. 
Can you explain the reason for that check? I can't see a reason for it 
to be there, and it seems like it should be Auth::getAuth() instead of 
!Auth::getAuth() at least.

> So if Prefs::_callHooks() is only invoked by Prefs::retrieve(), then is
> something wrongly calling Prefs::retrieve?

Yes, and worse, prefs caching is failing. It'd be helpful to see the 
results of debug_backtrace() from within one of your hooks, and 
preferably from 2 or 3 invocations of the hook, so that I can see the 
full call trace that results in the hook being re-called.

> data structures must be getting created on an import. I go from 
> having a 200Kb
> file that I'm importing to having a single Apache process with a 
> memory size of 100-300Mb, which troubles me a little bit.

Worth looking at memory consumption with apd or xdebug; this could be 
calendar stuff that isn't being cleaned up for some reason. You could 
look at one of the loops in kronolith/data.php and see if a few 
judicious unset() calls help.

-chuck

-- 
"But she goes not abroad in search of monsters to destroy." - John 
Quincy Adams


More information about the horde mailing list