[dev] Horde.php
steve
mailling at gmx.co.uk
Thu Feb 5 14:03:54 PST 2004
About Horde.php, I have several proposals.
1)
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';
---
> include_once HORDE_LIBS . 'Horde/Auth.php';
> include_once HORDE_LIBS . 'Horde/CLI.php';
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
> }
3) Some Horde applications call directly a hook, because the method
callHook always wants to return an error if the hook doesn't exist, so I
propose this:
1060a1065,1066
> * @param optional boolean $no_error If turned to true, and if the
function
> * to call doesn't exist, return null
1064c1070
< function callHook($hook, $args = array(), $app = 'horde')
---
> function callHook($hook, $args = array(), $app = 'horde', $no_error
= true)
1068,1069c1074,1077
< if (file_exists($registry->getParam('fileroot', $app) .
'/config/hooks.php')) {
< require_once $registry->getParam('fileroot', $app) .
'/config/hooks.php';
---
> $path = $registry->getParam('fileroot', $app);
>
> if (file_exists($path . '/config/hooks.php')) {
> require_once $path . '/config/hooks.php';
1071a1080,1081
> } elseif ($no_error) {
> return null;
More information about the dev
mailing list