[dev] [commits] Horde-Hatchery branch master updated. f0daa2470ea069c3488276d2ecb1f92c6fdc86b3

Chuck Hagenbuch chuck at horde.org
Mon Aug 17 03:22:38 UTC 2009


Quoting Michael M Slusarz <slusarz at horde.org>:

> commit f0daa2470ea069c3488276d2ecb1f92c6fdc86b3
> Author: Michael M Slusarz <slusarz at curecanti.org>
> Date:   Fri Aug 7 12:17:37 2009 -0600
>
>     Initial stab at moving base.php code into Application.php
>
>     Using IMP as a test case.
>
>     Proposed usage:
>     Every application script directly require_once's Application.php
>     This inits HORDE_BASE and Autoloading.
>     To init app, call new ***_Application(array('init' => $foo))
>     where $foo is either true or an array of options to pass to init().
>
>     lib/base.local.php is now config/horde.local.php

-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));

Changing from base.php to Application.php is semantic and fine. I  
don't like the new IMP_Application line though.

First of all, it screams side effects - creating a new object but not  
assigning it anywhere.

Second, why the 'init' argument? When do we need this kind of object  
but not need to init? Is this an instance where a singleton would be  
appropriate?

To be clear I do like the idea of having a base Application object and  
want to go there. I just don't think this is the right implementation  
yet.

-chuck


More information about the dev mailing list