Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some minor issues with the way the transport mechanisms are cal…

…led in SendGrid, and added protected accessors so that they couldn't be overwritten by outside influences
  • Loading branch information...
commit 9b75b71e3dde4eeeeaae6d8e8d512ebb239b6264 1 parent 72693ec
CJ Buchmann authored
Showing with 16 additions and 4 deletions.
  1. +16 −4 SendGrid.php
View
20 SendGrid.php
@@ -2,9 +2,13 @@
class SendGrid
{
- private $namespace = "SendGrid",
- $username,
- $password;
+ protected $namespace = "SendGrid",
+ $username,
+ $password;
+
+ // Available transport mechanisms
+ protected $web,
+ $smtp;
public function __construct($username, $password)
{
@@ -15,7 +19,15 @@ public function __construct($username, $password)
public function __get($api)
{
$name = $api;
- $api = "$this->namespace\\".ucwords($api);
+
+ if($this->$name != null)
+ {
+ return $this->name;
+ }
+
+ echo "creating new instance";
+
+ $api = $this->namespace . "\\" . ucwords($api);
$class_name = str_replace('\\', '/', "$api.php");
$file = __dir__ . DIRECTORY_SEPARATOR . $class_name;
Please sign in to comment.
Something went wrong with that request. Please try again.