git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7524 b9a71923-0436-4b27-9f14-aed3839534dd

This commit is contained in:
rGaillard
2011-07-06 10:54:11 +00:00
parent ba9cdcf295
commit 8a59d0dc41
5398 changed files with 482149 additions and 0 deletions
@@ -0,0 +1,46 @@
<?php
/**
* EasySwift Response Tracker
* Please read the LICENSE file
* @copyright Chris Corbyn <chris@w3style.co.uk>
* @author Chris Corbyn <chris@w3style.co.uk>
* @package EasySwift
* @license GNU Lesser General Public License
*/
require_once dirname(__FILE__) . "/../ClassLoader.php";
Swift_ClassLoader::load("Swift_Events_ResponseListener");
/**
* EasySwift, Swift Response Tracker.
* Updates properties in EasySwift when a response is received by Swift.
* @package EasySwift
* @author Chris Corbyn <chris@w3style.co.uk>
*/
class Swift_Plugin_EasySwiftResponseTracker implements Swift_Events_ResponseListener
{
/**
* The target object to update
* @var EasySwift
*/
protected $target = null;
/**
* Constructor
* @param EasySwift The instance of EasySwift to run against
*/
public function __construct($obj)
{
$this->target = $obj;
}
/**
* Response listener method
* @param Swift_Events_ResponseEvent The event occurred in Swift
*/
public function responseReceived(Swift_Events_ResponseEvent $e)
{
$this->target->lastResponse = $e->getString();
$this->target->responseCode = $e->getCode();
}
}