diff options
author | Elmer Thomas <elmer@thinkingserious.com> | 2016-03-20 20:11:15 -0700 |
---|---|---|
committer | Elmer Thomas <elmer@thinkingserious.com> | 2016-03-20 20:11:15 -0700 |
commit | a6c3ef243e52219c196ec19087b523c51aef9427 (patch) | |
tree | fac95c5b20578c324d2d47622df1a24e311781f9 /lib/SendGrid/config.php | |
parent | 3e52d93ef8aa82067761aceaa42d1df6cf0ac71d (diff) | |
download | php-http-client-a6c3ef243e52219c196ec19087b523c51aef9427.zip php-http-client-a6c3ef243e52219c196ec19087b523c51aef9427.tar.gz php-http-client-a6c3ef243e52219c196ec19087b523c51aef9427.tar.bz2 |
Updates for Packagist
Diffstat (limited to 'lib/SendGrid/config.php')
-rw-r--r-- | lib/SendGrid/config.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/SendGrid/config.php b/lib/SendGrid/config.php new file mode 100644 index 0000000..5c4383e --- /dev/null +++ b/lib/SendGrid/config.php @@ -0,0 +1,36 @@ +<?php +/** + * Environment Variable Configuration + * + * PHP version 5.2 + * + * @author Matt Bernier <dx@sendgrid.com> + * @author Elmer Thomas <dx@sendgrid.com> + * @copyright 2016 SendGrid + * @license https://opensource.org/licenses/MIT The MIT License + * @version GIT: <git_id> + * @link http://packagist.org/packages/sendgrid/php-http-client + */ +namespace SendGrid; + +/** + * Sets environment variables. + */ +class Config +{ + /** + * Setup the environment variables + * + * @param string $base_path path to your config file. + * @param string $config_filename name of the config file. + */ + function __construct($base_path, $config_filename) + { + $handle = fopen($base_path.'/'.$config_filename, "r"); + while (($line = fgets($handle)) !== false) { + putenv(trim(preg_replace('/\s+/', ' ', $line))); + } + fclose($handle); + } +} +?> |