Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Question about the $Configuration scheme

edited October 2010 in Vanilla 2.0 - 2.8
First of all, I'd like to say that I absolutely LOVE Vanilla 2. I just have a question that I'm burning to ask.

I see the conf.php file containing 3 dimensional arrays and a bunch of code that iterates through these arrays from input like: Gdn::Config('Database.Host', '');

My question is: why is it necessary to make this huge round-the-world code?

For instance, instead of:
$Configuration['Database']['Host'] = 'whatever';

and accessing it like:
$this->_DatabaseInfo['HostName'] = Gdn::Config('Database.Host', '');

Why go to all that trouble when you could do something like:
$Configuration['Database.Host'] = 'whatever';

and access it like:
$this->_DatabaseInfo['HostName'] = $Configuration['Database.Host'];

It just seems overly complicated for no reason. If you could let me know why it has to be that way, I'd love to know!


  • Options
    LincLinc Detroit Admin
    That's not actually how you access config values in practice. You'd do this:
    $var = C('Garden.Feature.Option');
  • Options
    I've seen it that way too but that was taken directly from class.sqldriver.php:1038 on 2.0.11

    But I'm still wondering why so much effort for such a simple task?
Sign In or Register to comment.