Skip to content

Commit

Permalink
remove SwiftMailer and add as dependency through Composer, update doc…
Browse files Browse the repository at this point in the history
…umentation

remove SwiftMailer, add as dependency through Composer

Update docs, change lib loading and dependencies

Remove additional path elements because PEAR is clevererer than I gave it credit for...

Closes #11
Closes #22
  • Loading branch information
martyndavies authored and theycallmeswift committed Apr 3, 2013
1 parent f978cad commit f57364b
Show file tree
Hide file tree
Showing 166 changed files with 90 additions and 17,903 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Test/coverage/*
examples/*
dist/
Test/coverage/*
examples/*
dist/
vendor/*
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ Before we begin using the library, its important to understand a few things abou
## Mail Usage ##
To begin using this library, you must first include it
To begin using this library, you must first include it and the dependencies. Composer makes this easy, just add:
```php
include 'path/to/sendgrid-php/SendGrid_loader.php';
require 'vendor/autoload.php';
```
This will include both the SendGrid library, and the SwiftMailer dependency.
Then, initialize the SendGrid object with your SendGrid credentials
```php
Expand Down
8 changes: 7 additions & 1 deletion SendGrid/Smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ class Smtp extends Api implements MailInterface

public function __construct($username, $password)
{
require_once ROOT_DIR . 'lib/swift/swift_required.php';
/* check for SwiftMailer,
* if it doesn't exist, try loading
* it from Pear
*/
if (!class_exists('Swift')) {
require_once 'swift_required.php';
}
call_user_func_array("parent::__construct", func_get_args());

//set the default port
Expand Down
2 changes: 1 addition & 1 deletion Test/a_loaderTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

//we'll use this class to autoload the appropriate files
require_once __dir__ . "/../SendGrid_loader.php";
require_once __dir__ . "/../vendor/autoload.php";

//include any mock classes
require_once __dir__ . "/Mock/Mock_loader.php";
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
"license": "MIT",
"autoload": {
"files": ["SendGrid_loader.php"]
},
"require": {
"swiftmailer/swiftmailer": "v4.3.0"
}

}
70 changes: 70 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 0 additions & 60 deletions lib/swift/CHANGES

This file was deleted.

165 changes: 0 additions & 165 deletions lib/swift/LICENSE

This file was deleted.

30 changes: 0 additions & 30 deletions lib/swift/README

This file was deleted.

1 change: 0 additions & 1 deletion lib/swift/VERSION

This file was deleted.

Loading

0 comments on commit f57364b

Please sign in to comment.