diff --git a/api/BusinessLogic/Emails/BasicEmailSender.php b/api/BusinessLogic/Emails/BasicEmailSender.php
index a93aad9f..058ef937 100644
--- a/api/BusinessLogic/Emails/BasicEmailSender.php
+++ b/api/BusinessLogic/Emails/BasicEmailSender.php
@@ -26,7 +26,8 @@ class BasicEmailSender implements EmailSender {
$mailer->Password = $heskSettings['smtp_password'];
}
- $mailer->FromName = $heskSettings['noreply_name'] ? $heskSettings['noreply_name'] : '';
+ $mailer->FromName = $heskSettings['noreply_name'] !== null &&
+ $heskSettings['noreply_name'] !== '' ? $heskSettings['noreply_name'] : '';
$mailer->From = $heskSettings['noreply_mail'];
if ($emailBuilder->to !== null) {
@@ -58,6 +59,13 @@ class BasicEmailSender implements EmailSender {
}
$mailer->Timeout = $heskSettings['smtp_timeout'];
+ if ($emailBuilder->attachments !== null) {
+ foreach ($emailBuilder->attachments as $attachment) {
+ $mailer->addAttachment(__DIR__ . '/../../../' . $heskSettings['attach_dir'] . '/' . $attachment->savedName,
+ $attachment->fileName);
+ }
+ }
+
if ($mailer->send()) {
return true;
}
diff --git a/api/BusinessLogic/Emails/EmailSender.php b/api/BusinessLogic/Emails/EmailSender.php
index 2cd191bc..4f300529 100644
--- a/api/BusinessLogic/Emails/EmailSender.php
+++ b/api/BusinessLogic/Emails/EmailSender.php
@@ -15,7 +15,7 @@ interface EmailSender {
* @param $heskSettings array
* @param $modsForHeskSettings array
* @param $sendAsHtml bool
- * @return bool|string true if message sent successfully, error string otherwise
+ * @return bool|string|\stdClass true if message sent successfully, string for PHPMail/Smtp error, stdClass for Mailgun error
*/
function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings, $sendAsHtml);
}
\ No newline at end of file
diff --git a/api/BusinessLogic/Emails/MailgunEmailSender.php b/api/BusinessLogic/Emails/MailgunEmailSender.php
index c29df57e..58c53e4e 100644
--- a/api/BusinessLogic/Emails/MailgunEmailSender.php
+++ b/api/BusinessLogic/Emails/MailgunEmailSender.php
@@ -5,25 +5,69 @@ namespace BusinessLogic\Emails;
use BusinessLogic\Tickets\Attachment;
use BusinessLogic\Tickets\Ticket;
+use Mailgun\Mailgun;
class MailgunEmailSender implements EmailSender {
- /**
- * @param $emailBuilder EmailBuilder
- * @param $heskSettings array
- * @param $modsForHeskSettings array
- */
- function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings) {
- // TODO: Implement sendEmail() method.
+ function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings, $sendAsHtml) {
+ $mailgunArray = array();
+
+ $mailgunArray['from'] = $heskSettings['noreply_mail']; // Email Address
+ if ($heskSettings['noreply_name'] !== null && $heskSettings['noreply_name'] !== '') {
+ $mailgunArray['from'] = "{$heskSettings['noreply_name']} <{$heskSettings['noreply_mail']}>"; // Name and address
+ }
+
+ $mailgunArray['to'] = implode(',', $emailBuilder->to);
+
+ if ($emailBuilder->cc !== null) {
+ $mailgunArray['cc'] = implode(',', $emailBuilder->cc);
+ }
+
+ if ($emailBuilder->bcc !== null) {
+ $mailgunArray['bcc'] = implode(',', $emailBuilder->bcc);
+ }
+
+ $mailgunArray['subject'] = $emailBuilder->subject;
+ $mailgunArray['text'] = $emailBuilder->message;
+
+ if ($sendAsHtml) {
+ $mailgunArray['html'] = $emailBuilder->htmlMessage;
+ }
+
+ $mailgunAttachments = array();
+ if ($emailBuilder->attachments !== null) {
+ foreach ($emailBuilder->attachments as $attachment) {
+ $mailgunAttachments[] = array(
+ 'remoteName' => $attachment->fileName,
+ 'filePath' => __DIR__ . '/../../../' . $heskSettings['attach_dir'] . '/' . $attachment->savedName
+ );
+ }
+ }
+
+ var_dump($mailgunArray);
+
+ $result = $this->sendMessage($mailgunArray, $mailgunAttachments, $modsForHeskSettings);
+
+
+ if (isset($result->http_response_code)
+ && $result->http_response_code === 200) {
+ return true;
+ }
+
+ return $result;
}
- /**
- * @param $emailBuilder EmailBuilder
- * @param $ticket Ticket
- * @param $attachments Attachment[]
- * @param $heskSettings array
- * @param $modsForHeskSettings array
- */
- function sendEmailWithTicket($emailBuilder, $ticket, $attachments, $heskSettings, $modsForHeskSettings) {
- // TODO: Implement sendEmailWithTicket() method.
+ private function sendMessage($mailgunArray, $attachments, $modsForHeskSettings) {
+ $messageClient = new Mailgun($modsForHeskSettings['mailgun_api_key']);
+
+ $mailgunAttachments = array();
+ if (count($attachments) > 0) {
+ $mailgunAttachments = array(
+ 'attachment' => $attachments
+ );
+ }
+
+ $result = $messageClient->sendMessage($modsForHeskSettings['mailgun_domain'], $mailgunArray, $mailgunAttachments);
+
+ return $result;
}
}
\ No newline at end of file
diff --git a/api/Tests/BusinessLogic/Emails/BasicEmailSenderIntegrationTest.php b/api/Tests/BusinessLogic/Emails/BasicEmailSenderIntegrationTest.php
index d71fe09f..4c946738 100644
--- a/api/Tests/BusinessLogic/Emails/BasicEmailSenderIntegrationTest.php
+++ b/api/Tests/BusinessLogic/Emails/BasicEmailSenderIntegrationTest.php
@@ -2,9 +2,10 @@
namespace BusinessLogic\Emails;
-use PHPUnit\Framework\TestCase;
+use BusinessLogic\IntegrationTestCaseBase;
+use BusinessLogic\Tickets\Attachment;
-class BasicEmailSenderIntegrationTest extends TestCase {
+class BasicEmailSenderIntegrationTest extends IntegrationTestCaseBase {
/**
* @var $emailSender BasicEmailSender;
*/
@@ -20,9 +21,16 @@ class BasicEmailSenderIntegrationTest extends TestCase {
*/
private $modsForHeskSettings;
+ /**
+ * @var $attachmentsToPurge string[]
+ */
+ private $attachmentsToPurge;
+
protected function setUp() {
global $hesk_settings, $modsForHesk_settings;
+ $this->skip();
+
if (!defined('IN_SCRIPT')) {
define('IN_SCRIPT', 1);
}
@@ -32,6 +40,13 @@ class BasicEmailSenderIntegrationTest extends TestCase {
$this->emailSender = new BasicEmailSender();
$this->heskSettings = $hesk_settings;
$this->modsForHeskSettings = $modsForHesk_settings;
+ $this->attachmentsToPurge = array();
+ }
+
+ protected function tearDown() {
+ foreach ($this->attachmentsToPurge as $file) {
+ unlink($file);
+ }
}
function testItCanSendHtmlMail() {
@@ -45,6 +60,24 @@ class BasicEmailSenderIntegrationTest extends TestCase {
$emailBuilder->htmlMessage = "Test HTML message";
$emailBuilder->subject = "BasicEmailSenderIntegrationTest";
+ // Uncomment to test attachments.
+ $attachment = new Attachment();
+ $attachment->id = 1;
+ $attachment->fileName = "file.txt";
+ $attachment->savedName = "test1.txt";
+ $filename1 = __DIR__ . '/../../../../' . $this->heskSettings['attach_dir'] . '/' . $attachment->savedName;
+ file_put_contents($filename1, 'TEST DATA');
+
+ $otherAttachment = new Attachment();
+ $otherAttachment->id = 2;
+ $otherAttachment->fileName = "file2.txt";
+ $otherAttachment->savedName = "test2.txt";
+ $filename2 = __DIR__ . '/../../../../' . $this->heskSettings['attach_dir'] . '/' . $otherAttachment->savedName;
+ file_put_contents($filename2, 'TEST DATA 2');
+
+ $emailBuilder->attachments = array($attachment, $otherAttachment);
+ $this->attachmentsToPurge = array($filename1, $filename2);
+
//-- Act
$result = $this->emailSender->sendEmail($emailBuilder, $this->heskSettings, $this->modsForHeskSettings, true);
diff --git a/api/Tests/BusinessLogic/Emails/MailgunEmailSenderIntegrationTest.php b/api/Tests/BusinessLogic/Emails/MailgunEmailSenderIntegrationTest.php
new file mode 100644
index 00000000..1a5d5ec3
--- /dev/null
+++ b/api/Tests/BusinessLogic/Emails/MailgunEmailSenderIntegrationTest.php
@@ -0,0 +1,109 @@
+skip();
+
+ if (!defined('IN_SCRIPT')) {
+ define('IN_SCRIPT', 1);
+ }
+ require(__DIR__ . '/../../../../hesk_settings.inc.php');
+ require(__DIR__ . '/../../integration_test_mfh_settings.php');
+
+ $this->emailSender = new MailgunEmailSender();
+ $this->heskSettings = $hesk_settings;
+ $this->modsForHeskSettings = $modsForHesk_settings;
+ $this->attachmentsToPurge = array();
+ }
+
+ protected function tearDown() {
+ foreach ($this->attachmentsToPurge as $file) {
+ unlink($file);
+ }
+ }
+
+ function testItCanSendMail() {
+ //-- Arrange
+ $emailBuilder = new EmailBuilder();
+ $emailBuilder->to = array('mfh1@mailinator.com');
+ $emailBuilder->cc = array('mfh2@mailinator.com');
+ $emailBuilder->bcc = array('mfh3@mailinator.com');
+ $emailBuilder->message = "Test PLAIN TEXT message";
+ $emailBuilder->htmlMessage = "Test HTML message";
+ $emailBuilder->subject = "MailgunEmailSenderIntegrationTest";
+
+ // Uncomment to test attachments.
+ $attachment = new Attachment();
+ $attachment->id = 1;
+ $attachment->fileName = "file.txt";
+ $attachment->savedName = "test1.txt";
+ $filename1 = __DIR__ . '/../../../../' . $this->heskSettings['attach_dir'] . '/' . $attachment->savedName;
+ file_put_contents($filename1, 'TEST DATA');
+
+ $otherAttachment = new Attachment();
+ $otherAttachment->id = 2;
+ $otherAttachment->fileName = "file2.txt";
+ $otherAttachment->savedName = "test2.txt";
+ $filename2 = __DIR__ . '/../../../../' . $this->heskSettings['attach_dir'] . '/' . $otherAttachment->savedName;
+ file_put_contents($filename2, 'TEST DATA 2');
+
+ $emailBuilder->attachments = array($attachment, $otherAttachment);
+ $this->attachmentsToPurge = array($filename1, $filename2);
+
+
+ //-- Act
+ $result = $this->emailSender->sendEmail($emailBuilder, $this->heskSettings, $this->modsForHeskSettings, true);
+
+ //-- Assert
+ if ($result !== true) {
+ $this->fail($result);
+ }
+ }
+
+ function testItCanSendPlaintextMail() {
+ //-- Arrange
+ //$hesk_settings['smtp'] = 0 //Uncomment this to use PHPMail
+ $emailBuilder = new EmailBuilder();
+ $emailBuilder->to = array('mfh1@mailinator.com');
+ $emailBuilder->cc = array('mfh2@mailinator.com');
+ $emailBuilder->bcc = array('mfh3@mailinator.com');
+ $emailBuilder->message = "Test PLAIN TEXT message";
+ $emailBuilder->subject = "MailgunEmailSenderIntegrationTest";
+
+
+ //-- Act
+ $result = $this->emailSender->sendEmail($emailBuilder, $this->heskSettings, $this->modsForHeskSettings, false);
+
+ //-- Assert
+ if ($result !== true) {
+ $this->fail($result);
+ }
+ }
+}
diff --git a/api/Tests/BusinessLogic/IntegrationTestCaseBase.php b/api/Tests/BusinessLogic/IntegrationTestCaseBase.php
new file mode 100644
index 00000000..963f223c
--- /dev/null
+++ b/api/Tests/BusinessLogic/IntegrationTestCaseBase.php
@@ -0,0 +1,10 @@
+markTestSkipped(sprintf("Skipping Integration Test %s", get_class($this)));
+ }
+}
diff --git a/api/Tests/bootstrap.php b/api/Tests/bootstrap.php
index 2e555474..a728a8a5 100644
--- a/api/Tests/bootstrap.php
+++ b/api/Tests/bootstrap.php
@@ -1,2 +1,3 @@
=5.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Clue\\StreamFilter\\": "src/"
+ },
+ "files": [
+ "src/functions.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christian Lück",
+ "email": "christian@lueck.tv"
+ }
+ ],
+ "description": "A simple and modern approach to stream filtering in PHP",
+ "homepage": "https://github.com/clue/php-stream-filter",
+ "keywords": [
+ "bucket brigade",
+ "callback",
+ "filter",
+ "php_user_filter",
+ "stream",
+ "stream_filter_append",
+ "stream_filter_register"
+ ],
+ "time": "2015-11-08T23:41:30+00:00"
+ },
{
"name": "doctrine/instantiator",
"version": "dev-master",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/instantiator.git",
- "reference": "68099b02b60bbf3b088ff5cb67bf506770ef9cac"
+ "url": "https://github.com/doctrine/instantiator.git",
+ "reference": "68099b02b60bbf3b088ff5cb67bf506770ef9cac"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/68099b02b60bbf3b088ff5cb67bf506770ef9cac",
+ "reference": "68099b02b60bbf3b088ff5cb67bf506770ef9cac",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3,<8.0-DEV"
+ },
+ "require-dev": {
+ "athletic/athletic": "~0.1.8",
+ "ext-pdo": "*",
+ "ext-phar": "*",
+ "phpunit/phpunit": "~4.0",
+ "squizlabs/php_codesniffer": "~2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "http://ocramius.github.com/"
+ }
+ ],
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "homepage": "https://github.com/doctrine/instantiator",
+ "keywords": [
+ "constructor",
+ "instantiate"
+ ],
+ "time": "2017-01-23 09:23:06"
+ },
+ {
+ "name": "guzzle/guzzle",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/guzzle3.git",
+ "reference": "f7778ed85e3db90009d79725afd6c3a82dab32fe"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/f7778ed85e3db90009d79725afd6c3a82dab32fe",
+ "reference": "f7778ed85e3db90009d79725afd6c3a82dab32fe",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "php": ">=5.3.3",
+ "symfony/event-dispatcher": "~2.1"
+ },
+ "replace": {
+ "guzzle/batch": "self.version",
+ "guzzle/cache": "self.version",
+ "guzzle/common": "self.version",
+ "guzzle/http": "self.version",
+ "guzzle/inflection": "self.version",
+ "guzzle/iterator": "self.version",
+ "guzzle/log": "self.version",
+ "guzzle/parser": "self.version",
+ "guzzle/plugin": "self.version",
+ "guzzle/plugin-async": "self.version",
+ "guzzle/plugin-backoff": "self.version",
+ "guzzle/plugin-cache": "self.version",
+ "guzzle/plugin-cookie": "self.version",
+ "guzzle/plugin-curlauth": "self.version",
+ "guzzle/plugin-error-response": "self.version",
+ "guzzle/plugin-history": "self.version",
+ "guzzle/plugin-log": "self.version",
+ "guzzle/plugin-md5": "self.version",
+ "guzzle/plugin-mock": "self.version",
+ "guzzle/plugin-oauth": "self.version",
+ "guzzle/service": "self.version",
+ "guzzle/stream": "self.version"
+ },
+ "require-dev": {
+ "doctrine/cache": "~1.3",
+ "monolog/monolog": "~1.0",
+ "phpunit/phpunit": "3.7.*",
+ "psr/log": "~1.0",
+ "symfony/class-loader": "~2.1",
+ "zendframework/zend-cache": "2.*,<2.3",
+ "zendframework/zend-log": "2.*,<2.3"
+ },
+ "suggest": {
+ "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated."
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Guzzle": "src/",
+ "Guzzle\\Tests": "tests/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Guzzle Community",
+ "homepage": "https://github.com/guzzle/guzzle/contributors"
+ }
+ ],
+ "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "client",
+ "curl",
+ "framework",
+ "http",
+ "http client",
+ "rest",
+ "web service"
+ ],
+ "abandoned": "guzzlehttp/guzzle",
+ "time": "2016-10-26 18:22:07"
+ },
+ {
+ "name": "guzzlehttp/guzzle",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/guzzle.git",
+ "reference": "6a99df94a22f01b4b9c32ed8789cf30d05bdba92"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/6a99df94a22f01b4b9c32ed8789cf30d05bdba92",
+ "reference": "6a99df94a22f01b4b9c32ed8789cf30d05bdba92",
+ "shasum": ""
+ },
+ "require": {
+ "guzzlehttp/promises": "^1.0",
+ "guzzlehttp/psr7": "^1.3.1",
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "ext-curl": "*",
+ "phpunit/phpunit": "^4.0",
+ "psr/log": "^1.0"
+ },
+ "suggest": {
+ "psr/log": "Required for using the Log middleware"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "6.2-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/functions_include.php"
+ ],
+ "psr-4": {
+ "GuzzleHttp\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Guzzle is a PHP HTTP client library",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "client",
+ "curl",
+ "framework",
+ "http",
+ "http client",
+ "rest",
+ "web service"
+ ],
+ "time": "2017-02-19 15:59:27"
+ },
+ {
+ "name": "guzzlehttp/promises",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/promises.git",
+ "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
+ "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Promise\\": "src/"
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Guzzle promises library",
+ "keywords": [
+ "promise"
+ ],
+ "time": "2016-12-20 10:07:11"
+ },
+ {
+ "name": "guzzlehttp/psr7",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/psr7.git",
+ "reference": "41972f428b31bc3ebff0707f63dd2165d3ac4cf6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/41972f428b31bc3ebff0707f63dd2165d3ac4cf6",
+ "reference": "41972f428b31bc3ebff0707f63dd2165d3ac4cf6",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0",
+ "psr/http-message": "~1.0"
+ },
+ "provide": {
+ "psr/http-message-implementation": "1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Psr7\\": "src/"
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Tobias Schultze",
+ "homepage": "https://github.com/Tobion"
+ }
+ ],
+ "description": "PSR-7 message implementation that also provides common utility methods",
+ "keywords": [
+ "http",
+ "message",
+ "request",
+ "response",
+ "stream",
+ "uri",
+ "url"
+ ],
+ "time": "2017-02-18 11:43:27"
+ },
+ {
+ "name": "mailgun/mailgun-php",
+ "version": "v2.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/mailgun/mailgun-php.git",
+ "reference": "54b7f851b8e0241d593897dc2d50906bf4a43995"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/mailgun/mailgun-php/zipball/54b7f851b8e0241d593897dc2d50906bf4a43995",
+ "reference": "54b7f851b8e0241d593897dc2d50906bf4a43995",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5|^7.0",
+ "php-http/discovery": "^1.0",
+ "php-http/httplug": "^1.0",
+ "php-http/message": "^1.0",
+ "php-http/multipart-stream-builder": "^0.1"
+ },
+ "require-dev": {
+ "php-http/guzzle6-adapter": "^1.0",
+ "phpunit/phpunit": "~4.6"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Mailgun": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Travis Swientek",
+ "email": "travis@mailgunhq.com"
+ }
+ ],
+ "description": "The Mailgun SDK provides methods for all API functions.",
+ "time": "2016-08-10T16:58:18+00:00"
+ },
+ {
+ "name": "myclabs/deep-copy",
+ "version": "1.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe",
+ "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "doctrine/collections": "1.*",
+ "phpunit/phpunit": "~4.1"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Create deep copies (clones) of your objects",
+ "homepage": "https://github.com/myclabs/DeepCopy",
+ "keywords": [
+ "clone",
+ "copy",
+ "duplicate",
+ "object",
+ "object graph"
+ ],
+ "time": "2017-01-26T22:05:40+00:00"
+ },
+ {
+ "name": "php-http/curl-client",
+ "version": "v1.7.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/curl-client.git",
+ "reference": "0972ad0d7d37032a52077a5cbe27cf370f2007d8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/curl-client/zipball/0972ad0d7d37032a52077a5cbe27cf370f2007d8",
+ "reference": "0972ad0d7d37032a52077a5cbe27cf370f2007d8",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "php": "^5.5 || ^7.0",
+ "php-http/discovery": "^1.0",
+ "php-http/httplug": "^1.0",
+ "php-http/message": "^1.2",
+ "php-http/message-factory": "^1.0.2"
+ },
+ "provide": {
+ "php-http/async-client-implementation": "1.0",
+ "php-http/client-implementation": "1.0"
+ },
+ "require-dev": {
+ "guzzlehttp/psr7": "^1.0",
+ "php-http/client-integration-tests": "^0.5.1",
+ "phpunit/phpunit": "^4.8.27",
+ "zendframework/zend-diactoros": "^1.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Http\\Client\\Curl\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Михаил Красильников",
+ "email": "m.krasilnikov@yandex.ru"
+ }
+ ],
+ "description": "cURL client for PHP-HTTP",
+ "homepage": "http://php-http.org",
+ "keywords": [
+ "curl",
+ "http"
+ ],
+ "time": "2017-02-09T15:18:33+00:00"
+ },
+ {
+ "name": "php-http/discovery",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/discovery.git",
+ "reference": "cc5669d9cb51170ad0278a3b984cd3c7894d6ff9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/discovery/zipball/cc5669d9cb51170ad0278a3b984cd3c7894d6ff9",
+ "reference": "cc5669d9cb51170ad0278a3b984cd3c7894d6ff9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5 || ^7.0"
+ },
+ "require-dev": {
+ "henrikbjorn/phpspec-code-coverage": "^2.0.2",
+ "php-http/httplug": "^1.0",
+ "php-http/message-factory": "^1.0",
+ "phpspec/phpspec": "^2.4",
+ "puli/composer-plugin": "1.0.0-beta10"
+ },
+ "suggest": {
+ "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories",
+ "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details."
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Http\\Discovery\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
+ }
+ ],
+ "description": "Finds installed HTTPlug implementations and PSR-7 message factories",
+ "homepage": "http://php-http.org",
+ "keywords": [
+ "adapter",
+ "client",
+ "discovery",
+ "factory",
+ "http",
+ "message",
+ "psr7"
+ ],
+ "time": "2017-02-12 08:49:24"
+ },
+ {
+ "name": "php-http/guzzle6-adapter",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/guzzle6-adapter.git",
+ "reference": "c0168c6e5fa286c3837310d591114d2683b9b9a5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/c0168c6e5fa286c3837310d591114d2683b9b9a5",
+ "reference": "c0168c6e5fa286c3837310d591114d2683b9b9a5",
+ "shasum": ""
+ },
+ "require": {
+ "guzzlehttp/guzzle": "^6.0",
+ "php": "^5.5 || ^7.0",
+ "php-http/httplug": "^1.0"
+ },
+ "provide": {
+ "php-http/async-client-implementation": "1.0",
+ "php-http/client-implementation": "1.0"
+ },
+ "require-dev": {
+ "ext-curl": "*",
+ "php-http/client-integration-tests": "^0.5.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Http\\Adapter\\Guzzle6\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
+ },
+ {
+ "name": "David de Boer",
+ "email": "david@ddeboer.nl"
+ }
+ ],
+ "description": "Guzzle 6 HTTP Adapter",
+ "homepage": "http://httplug.io",
+ "keywords": [
+ "Guzzle",
+ "http"
+ ],
+ "time": "2016-08-02 09:03:17"
+ },
+ {
+ "name": "php-http/httplug",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/httplug.git",
+ "reference": "f32fefee51cb96e99edb0c4bb1d11b5026ad5069"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/68099b02b60bbf3b088ff5cb67bf506770ef9cac",
- "reference": "68099b02b60bbf3b088ff5cb67bf506770ef9cac",
+ "url": "https://api.github.com/repos/php-http/httplug/zipball/f32fefee51cb96e99edb0c4bb1d11b5026ad5069",
+ "reference": "f32fefee51cb96e99edb0c4bb1d11b5026ad5069",
"shasum": ""
},
"require": {
- "php": ">=5.3,<8.0-DEV"
+ "php": ">=5.4",
+ "php-http/promise": "^1.0",
+ "psr/http-message": "^1.0"
},
"require-dev": {
- "athletic/athletic": "~0.1.8",
- "ext-pdo": "*",
- "ext-phar": "*",
- "phpunit/phpunit": "~4.0",
- "squizlabs/php_codesniffer": "~2.0"
+ "henrikbjorn/phpspec-code-coverage": "^1.0",
+ "phpspec/phpspec": "^2.4"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.2-dev"
}
},
"autoload": {
"psr-4": {
- "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ "Http\\Client\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -47,60 +690,247 @@
],
"authors": [
{
- "name": "Marco Pivetta",
- "email": "ocramius@gmail.com",
- "homepage": "http://ocramius.github.com/"
+ "name": "Eric GELOEN",
+ "email": "geloen.eric@gmail.com"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
}
],
- "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
- "homepage": "https://github.com/doctrine/instantiator",
+ "description": "HTTPlug, the HTTP client abstraction for PHP",
+ "homepage": "http://httplug.io",
"keywords": [
- "constructor",
- "instantiate"
+ "client",
+ "http"
],
- "time": "2017-01-23 09:23:06"
+ "time": "2017-01-02 06:37:42"
},
{
- "name": "myclabs/deep-copy",
- "version": "1.6.0",
+ "name": "php-http/message",
+ "version": "dev-master",
"source": {
"type": "git",
- "url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe"
+ "url": "https://github.com/php-http/message.git",
+ "reference": "13df8c48f40ca7925303aa336f19be4b80984f01"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe",
- "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe",
+ "url": "https://api.github.com/repos/php-http/message/zipball/13df8c48f40ca7925303aa336f19be4b80984f01",
+ "reference": "13df8c48f40ca7925303aa336f19be4b80984f01",
"shasum": ""
},
"require": {
- "php": ">=5.4.0"
+ "clue/stream-filter": "^1.3",
+ "php": ">=5.4",
+ "php-http/message-factory": "^1.0.2",
+ "psr/http-message": "^1.0"
},
"require-dev": {
- "doctrine/collections": "1.*",
- "phpunit/phpunit": "~4.1"
+ "akeneo/phpspec-skip-example-extension": "^1.0",
+ "coduo/phpspec-data-provider-extension": "^1.0",
+ "ext-zlib": "*",
+ "guzzlehttp/psr7": "^1.0",
+ "henrikbjorn/phpspec-code-coverage": "^1.0",
+ "phpspec/phpspec": "^2.4",
+ "slim/slim": "^3.0",
+ "zendframework/zend-diactoros": "^1.0"
+ },
+ "suggest": {
+ "ext-zlib": "Used with compressor/decompressor streams",
+ "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories",
+ "slim/slim": "Used with Slim Framework PSR-7 implementation",
+ "zendframework/zend-diactoros": "Used with Diactoros Factories"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.6-dev"
+ }
+ },
"autoload": {
"psr-4": {
- "DeepCopy\\": "src/DeepCopy/"
+ "Http\\Message\\": "src/"
+ },
+ "files": [
+ "src/filters.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
+ }
+ ],
+ "description": "HTTP Message related tools",
+ "homepage": "http://php-http.org",
+ "keywords": [
+ "http",
+ "message",
+ "psr-7"
+ ],
+ "time": "2017-02-14 08:58:37"
+ },
+ {
+ "name": "php-http/message-factory",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/message-factory.git",
+ "reference": "a2809d4fe294ebe8879aec8d4d5bf21faa029344"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/message-factory/zipball/a2809d4fe294ebe8879aec8d4d5bf21faa029344",
+ "reference": "a2809d4fe294ebe8879aec8d4d5bf21faa029344",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4",
+ "psr/http-message": "^1.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
- "description": "Create deep copies (clones) of your objects",
- "homepage": "https://github.com/myclabs/DeepCopy",
+ "authors": [
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
+ }
+ ],
+ "description": "Factory interfaces for PSR-7 HTTP Message",
+ "homepage": "http://php-http.org",
"keywords": [
- "clone",
- "copy",
- "duplicate",
- "object",
- "object graph"
+ "factory",
+ "http",
+ "message",
+ "stream",
+ "uri"
],
- "time": "2017-01-26T22:05:40+00:00"
+ "time": "2016-02-03 08:16:31"
+ },
+ {
+ "name": "php-http/multipart-stream-builder",
+ "version": "0.1.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/multipart-stream-builder.git",
+ "reference": "74d5ac517778ae87a065c6f4076316c35b58a777"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/74d5ac517778ae87a065c6f4076316c35b58a777",
+ "reference": "74d5ac517778ae87a065c6f4076316c35b58a777",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5 || ^7.0",
+ "php-http/discovery": "^1.0",
+ "php-http/message-factory": "^1.0.2",
+ "psr/http-message": "^1.0"
+ },
+ "require-dev": {
+ "php-http/message": "^1.5",
+ "phpunit/phpunit": "^4.8 || ^5.4",
+ "zendframework/zend-diactoros": "^1.3.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Http\\Message\\MultipartStream\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com"
+ }
+ ],
+ "description": "A builder class that help you create a multipart stream",
+ "homepage": "http://php-http.org",
+ "keywords": [
+ "factory",
+ "http",
+ "message",
+ "multipart stream",
+ "stream"
+ ],
+ "time": "2017-02-16T08:52:59+00:00"
+ },
+ {
+ "name": "php-http/promise",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/promise.git",
+ "reference": "810b30da8bcf69e4b82c4b9bc6b31518234293ab"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/promise/zipball/810b30da8bcf69e4b82c4b9bc6b31518234293ab",
+ "reference": "810b30da8bcf69e4b82c4b9bc6b31518234293ab",
+ "shasum": ""
+ },
+ "require-dev": {
+ "henrikbjorn/phpspec-code-coverage": "^1.0",
+ "phpspec/phpspec": "^2.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Http\\Promise\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
+ },
+ {
+ "name": "Joel Wurtz",
+ "email": "joel.wurtz@gmail.com"
+ }
+ ],
+ "description": "Promise used for asynchronous HTTP requests",
+ "homepage": "http://httplug.io",
+ "keywords": [
+ "promise"
+ ],
+ "time": "2016-01-28 07:54:12"
},
{
"name": "phpdocumentor/reflection-common",
@@ -756,6 +1586,56 @@
],
"time": "2016-12-08 20:27:08"
},
+ {
+ "name": "psr/http-message",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-message.git",
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP messages",
+ "homepage": "https://github.com/php-fig/http-message",
+ "keywords": [
+ "http",
+ "http-message",
+ "psr",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "time": "2016-08-06 14:39:51"
+ },
{
"name": "sebastian/code-unit-reverse-lookup",
"version": "dev-master",
@@ -1269,6 +2149,66 @@
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2016-10-03 07:35:21"
},
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "2.8.x-dev",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "3178c0e247b81da8a0265b460ac23bec6d2e6627"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3178c0e247b81da8a0265b460ac23bec6d2e6627",
+ "reference": "3178c0e247b81da8a0265b460ac23bec6d2e6627",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/config": "^2.0.5|~3.0.0",
+ "symfony/dependency-injection": "~2.6|~3.0.0",
+ "symfony/expression-language": "~2.6|~3.0.0",
+ "symfony/stopwatch": "~2.3|~3.0.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "https://symfony.com",
+ "time": "2017-02-18 19:13:35"
+ },
{
"name": "symfony/yaml",
"version": "dev-master",