[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Global Namespaces



On Sat, Mar 13, 2010 at 11:00 AM, Chris Travers <..hidden..> wrote:
> I am thinking of suggesting two global namespaces
>
> In package LedgerSMB
>
> use Class::Struct LedgerSMB::Globals => {
>               user => 'LedgerSMB::User',
>               session => 'LedgerSMB::Session',
>               config => 'LedgerSMB::ConfigFile',
>                        # Config settings, similar to Sysconfig today
> };
>
> our Globals = LedgerSMB::Globals->new();

Just to note, this would mean calls would look like:

LedgerSMB::Globals->user->username
and
LedgerSMB::Globals->config->globals->{auth_method};
>
> in pacakge LedgerSMB::Web:
> use Class::Struct LedgerSMB::Web::Globals => {
>               session => 'LedgerSMB::Session::Web',
>               request => 'LedgerSMB::Web::Request',
> };
>
> our Globals = LedgerSMB::Web::Globals->new();
>
> Any other globally accessible information that needs to be available
> globally through apps/scripts?


Follow-up question:  Should we have a separate .ini file for web
application configuration?

Best Wishes,
Chris Travers