Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add check for alternative SwiftMailer class #22

Closed
wants to merge 9 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

martyndavies commented Apr 3, 2013

No description provided.

@theycallmeswift theycallmeswift commented on an outdated diff Apr 3, 2013

SendGrid/Smtp.php
@@ -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 ROOT_DIR . 'lib/swift_required.php';
@theycallmeswift

theycallmeswift Apr 3, 2013

Contributor

why not:

require_once 'swift_required.php';

The place where pear installs things isn't necessarily lib is it? or in the same package?

Contributor

theycallmeswift commented Apr 3, 2013

Just one comment. After we address, I will rebase and merge.

Contributor

martyndavies commented Apr 3, 2013

Pear is actually /usr/share/swiftmailer on a unix env - but can be anywhere. Are we leaving it to the user to modify the location in this case?

Contributor

theycallmeswift commented Apr 3, 2013

but pear would automatically add that location to the users' classpath, no? So you would literally just do the following (without specifying the actual path):

require_once 'swift_required.php';
Contributor

martyndavies commented Apr 3, 2013

Indeed. Additional options on the user if not set in the classpath automatically through set_include_path in main app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment