summaryrefslogtreecommitdiffstats
path: root/lib/SendGrid/Config.php
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-05-11 12:32:50 -0700
committerElmer Thomas <elmer@thinkingserious.com>2016-05-11 12:32:50 -0700
commitd130a8e7102f7cbfc52c1f02d8a481e1fe898857 (patch)
tree10ce234bf9690a1829724682adea1649a8ea6fea /lib/SendGrid/Config.php
parent680ef8aa15d7b5636cb045bfb40546ac142b3728 (diff)
downloadphp-http-client-d130a8e7102f7cbfc52c1f02d8a481e1fe898857.zip
php-http-client-d130a8e7102f7cbfc52c1f02d8a481e1fe898857.tar.gz
php-http-client-d130a8e7102f7cbfc52c1f02d8a481e1fe898857.tar.bz2
Version Bump 2.0.2
Diffstat (limited to 'lib/SendGrid/Config.php')
-rw-r--r--lib/SendGrid/Config.php36
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);
+ }
+}
+?>