using Configuration File per environment (AdsApi PHP library)

10 views
Skip to first unread message

Andy Wallace

unread,
Sep 18, 2017, 3:05:47 PM9/18/17
to AdWords API Forum
I am upgrading from an old version of the Ads API to the latest. We have a different environment for each stage of our development process (Development, Stage, Production), and there are configuration differences between them. Pertinent to the AdsApi, the OAUTH2 information (client secret, etc).

I would like to keep these inside our current config file structure, where we have a different config file (different name) for each environment. The simplest way to do this would be to put the sections from adsapi_php.ini into our 'dev.ini', 'stage.ini', and production.ini files. The code almost seems to support this, but is hardcoded to use the adsapi_php.ini name, and looks in the "home" directory for that file. Any suggestions on how to handle this? Or should I just be hacking into the library code?

(also, please note that using generic terms like "LOGGING", "SOAP", and "OAUTH2" is not the best path to being used in a real-world environment, where those values could easily be overloaded).

Thanks

Peter Oliquino

unread,
Sep 19, 2017, 12:06:34 AM9/19/17
to AdWords API Forum
Hi Andy,

You may follow this section of the PHP configuration guide for the other options on how to access or use the adsapi_php.ini and its contents. Additionally, you may also refer to the upgrade guide should you require more information in migrating to the latest version.

Should you encounter any other issues and for other PHP library related concerns, you may get in touch with the PHP client library owners via this link for further assistance.

Best regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages