Skip to content
This repository was archived by the owner on Jul 28, 2018. It is now read-only.
This repository was archived by the owner on Jul 28, 2018. It is now read-only.

Use application.ini and Zend_Config for storing config data #42

@manticorp

Description

@manticorp

Instead of storing all the data in the bootstap, it would be very easy to just pass a config object to the constructor with the appropriate adapter name, e.g., in application.ini:

// Twitter API
twitter.consumerKey     = "sfgdreConsumerKeyrklelg123"
twitter.consumerSecret  = "aSFlgdgDGCoNSuMerSecRet1235nDFN243Aflskndf129"
twitter.callbackUrl     = "http://the/callback/url/here/"
twitter.siteUrl         = "https://api.twitter.com/oauth"
twitter.authorizeUrl    = "https://api.twitter.com/oauth/authenticate"
twitter.token_url       = "https://api.twitter.com/oauth/access_token"

and then just call, in the appropriate place:

$config = Zend_Registry::get('config');
$config = is_object($config) ? $config->toArray() : $config;
$this->_options = $config['twitter'];

Just my two cents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions