[dev] Horde.php #2
steve
mailling at gmx.co.uk
Fri Feb 6 00:57:34 PST 2004
I am sorry for the 1), I didn't look enough time, definetely!
For the 2, I provided a (new) patch, my configuration is quite specific,
and I didn't notice it.
430,433c431
< global $registry;
<
< /* Store the webroot in a local variable. */
< $webroot = $registry->getParam('webroot');
---
> static $webroot = array();
437,438c435,445
< } elseif (substr($webroot, -1) == '/') {
< return Horde::url($webroot . $uri, $full, $append_session);
---
> }
>
> global $registry;
>
> $app = $registry->getApp();
> if (!isset($webroot[$app])) {
> $webroot[$app] = $registry->getParam('webroot', $app);
> }
>
> if (substr($webroot, -1) == '/') {
> return Horde::url($webroot[$app] . $uri, $full,
$append_session);
440c447
< return Horde::url($webroot . '/' . $uri, $full, $append_session);
---
> return Horde::url($webroot[$app] . '/' . $uri, $full,
$append_session);
>Quoting steve <mailling at gmx.co.uk>:
>
> > I don't get why we are doing @include_once, and not require_once
> > Indeed, if the file is not there, a lot of thing are not going to work
> > anyway; but it is just more difficult to catch it (for the developpers))
> >
> > RCS file: /repository/horde/lib/Horde.php,v
> > retrieving revision 1.375
> > diff -w -b -r1.375 Horde.php
> > 150,151c150,151
> > < @include_once HORDE_LIBS . 'Horde/Auth.php';
> > < @include_once HORDE_LIBS . 'Horde/CLI.php';
>
>You included absolutely no context, but the only place I can find those
>calls is
>in Horde::fatal(). It would be pretty stupid to let a missing file kill the
>script while we were right in the middle of trying to die *usefully*.
>
> > 2)
> > When I used some profiler tools, I found that $webroot =
> > $registry->getParam('webroot'); is called a lot, so we could speed up the
> > things a little with:
> > 429a430,432
> > > static $webroot;
> > >
> > > if (!isset($webroot)) {
> > 433a437
> > > }
>
>This will break any URLs generated by the 2nd+ application that a page uses
>(like the portal page). A version of this patch that avoided that problem
>would
>be accepted.
>
>-chuck
More information about the dev
mailing list