diff options
author | Elmer Thomas <elmer@thinkingserious.com> | 2016-05-10 14:51:42 -0700 |
---|---|---|
committer | Elmer Thomas <elmer@thinkingserious.com> | 2016-05-10 14:51:42 -0700 |
commit | 998cabb2bcac20c871c69ca7839f76615d3516ae (patch) | |
tree | 59e1ee873dc51abd10a1b4bedce128c149e38871 | |
parent | 8ac5f8d145b12b0abd2e8c0df39d4145293af6ac (diff) | |
download | sendgrid-php-998cabb2bcac20c871c69ca7839f76615d3516ae.zip sendgrid-php-998cabb2bcac20c871c69ca7839f76615d3516ae.tar.gz sendgrid-php-998cabb2bcac20c871c69ca7839f76615d3516ae.tar.bz2 |
Debugging Travis Tests
-rw-r--r-- | lib/SendGrid.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/SendGrid.php b/lib/SendGrid.php index 0e72d85..93b3faf 100644 --- a/lib/SendGrid.php +++ b/lib/SendGrid.php @@ -19,6 +19,9 @@ class SendGrid { const VERSION = '5.0.0'; + protected + $namespace = 'SendGrid'; + public $client, $version = self::VERSION; @@ -39,4 +42,21 @@ class SendGrid $host = isset($options['host']) ? $options['host'] : 'https://api.sendgrid.com'; $this->client = new SendGrid\Client($host, $headers, '/v3', null); } + + public static function register_autoloader() + { + spl_autoload_register(array('SendGrid', 'autoloader')); + } + + public static function autoloader($class) + { + // Check that the class starts with 'SendGrid' + if ($class == 'SendGrid' || stripos($class, 'SendGrid\\') === 0) { + $file = str_replace('\\', '/', $class); + if (file_exists(dirname(__FILE__) . '/' . $file . '.php')) { + require_once(dirname(__FILE__) . '/' . $file . '.php'); + } + } + } + } |