Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

how to pass config parameters to class? #53

Closed
marckula opened this issue Oct 25, 2012 · 3 comments
Closed

how to pass config parameters to class? #53

marckula opened this issue Oct 25, 2012 · 3 comments

Comments

@marckula
Copy link

we have separate applications defined in Parse for our staging and development environments. in V1 of this library, we could pass the configuration paramaters when instantiating the parseRestClient class. This feature appears to be removed from V2 in favor of a configuration file.

Any suggestions?

@FredvanRijswijk
Copy link


class parseConfig{

    const APPID = '';
    const MASTERKEY = '';
    const RESTKEY = '';
    const PARSEURL = 'https://api.parse.com/1/';
}

?>```

@andrewscofield
Copy link
Owner

This scenario is exactly why I switched to a config file. Production, staging and dev environments can all have different parseConfig.php in each environment. This way you don't have to change your code when going from one environment to another.

@marckula
Copy link
Author

We use zend framework and store all our config options in a single application.ini file for prod, stage and dev. zend allows us to dynamically load config params based on SERVER_NAME env var.

Its convenient to be able to instantiate a class by passing config params.

On Nov 21, 2012, at 10:49 PM, apotropaic notifications@github.com wrote:

This scenario is exactly why I switched to a config file. Production, staging and dev environments can all have different parseConfig.php in each environment. This way you don't have to change your code when going from one environment to another.


Reply to this email directly or view it on GitHub.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants