/**
  * Batch Subscription to MailChimp Lists
  *
  * @author Ruchi Kothari
  * @return bool "true" on Success, "false" otherwise
  * @throws SWIFT_Exception If the Class is not Loaded
  */
 public function Subscribe()
 {
     if (!$this->GetIsClassLoaded()) {
         throw new SWIFT_Exception(SWIFT_CLASSNOTLOADED);
         return false;
     }
     $_SWIFT_UserSyncManagerObject = new SWIFT_UserSyncManager();
     $_subscriptionResult = $_SWIFT_UserSyncManagerObject->BatchSubscribe();
     $_errorString = "";
     if (isset($_subscriptionResult['error'])) {
         $_errorString .= $_subscriptionResult['error'];
     } else {
         if (isset($_subscriptionResult['lists'])) {
             foreach ($_subscriptionResult['lists'] as $_list) {
                 foreach ($_list['errors'] as $_error) {
                     $_errorString .= $_error['email'] . ' failed';
                     $_errorString .= ' Code: ' . $_error['code'];
                     $_errorString .= ' Message: ' . $_error['message'];
                 }
             }
         }
     }
     if (!empty($_errorString)) {
         $_errorString = $this->Language->Get('mc_error') . $_errorString;
         SWIFT_Loader::LoadLibrary('ErrorLog:ErrorLog');
         SWIFT_ErrorLog::Create(SWIFT_ErrorLog::TYPE_GENERAL, $_errorString);
     }
     return true;
 }
<?php

/**
 * @copyright      2001-2015 Kayako
 * @license        https://www.freebsd.org/copyright/freebsd-license.html
 * @link           https://github.com/kayako/basecamp-integration
 */
/**
 * Base class for oauth2 grant type
 *
 * @author Atul Atri
 */
SWIFT_Loader::LoadInterface('OAuth2:OAuth2GrantType');
SWIFT_Loader::LoadLibrary('OAuth2:OAuth2Exception');
SWIFT_Loader::LoadLibrary('HTTP:HttpCurl');
class SWIFT_OAuth2GrantTypeBase extends SWIFT_Library implements SWIFT_OAuth2GrantType_Interface
{
    protected $_paramNames = array();
    /**
     * Constructor
     *
     * @author Atul Atri
     *
     * @throws SWIFT_Exception
     */
    public function __construct()
    {
        parent::__construct();
        return true;
    }
    /**
<?php

/**
 * @copyright      2001-2015 Kayako
 * @license        https://www.freebsd.org/copyright/freebsd-license.html
 * @link           https://github.com/kayako/jira-integration
 */
SWIFT_Loader::LoadLibrary('HTTP:HTTPBase');
/**
 * HTTPResponse Class
 * Handles and abstracts the HTTP response returned from the HTTP Requests
 */
class SWIFT_HTTPResponse extends SWIFT_HTTPBase
{
    /**
     * The HTTP version (1.0, 1.1)
     *
     * @var string
     */
    protected $_Version;
    /**
     * The HTTP response code
     *
     * @var int
     */
    protected $_ResponseCode;
    /**
     * The HTTP response code as string
     * (e.g. 'Not Found' for 404 or 'Internal Server Error' for 500)
     *
     * @var string
<?php

/**
 * @copyright      2001-2015 Kayako
 * @license        https://www.freebsd.org/copyright/freebsd-license.html
 * @link           https://github.com/kayako/basecamp-integration
 */
/**
 * Description of OAuth2CodeGrant code grant
 *
 * @author atul atri
 */
SWIFT_Loader::LoadLibrary('OAuth2:OAuth2GrantTypeBase');
SWIFT_Loader::LoadLibrary('OAuth2:OAuth2Exception');
class SWIFT_OAuth2PasswordGrant extends SWIFT_OAuth2GrantTypeBase
{
    /**
     * Constructor
     *
     * @author Atul Atri
     *
     */
    public function __construct()
    {
        parent::__construct();
        return true;
    }
    /**
     * Destructor
     *
     * @author Atul Atri
<?php

/**
 * @copyright      2001-2015 Kayako
 * @license        https://www.freebsd.org/copyright/freebsd-license.html
 * @link           https://github.com/kayako/jira-integration
 */
SWIFT_Loader::LoadLibrary('HTTP:HTTPBase');
SWIFT_Loader::LoadLibrary('HTTP:HTTPResponse');
/**
 * The base class for all SWIFT_HTTP based library
 *
 * @author Abhinav Kumar
 */
class SWIFT_HTTPClient extends SWIFT_HTTPBase
{
    /**
     * Request method - defaults to SWIFT_HTTP::GET
     *
     * @var string
     */
    protected $_method = self::GET;
    /**
     * @var /SWIFT_HTTPAdapter
     */
    protected $Adapter = null;
    /**
     *
     * @var string
     */
    protected $_URI = null;
<?php

/**
 * @copyright      2001-2015 Kayako
 * @license        https://www.freebsd.org/copyright/freebsd-license.html
 * @link           https://github.com/kayako/jira-integration
 */
SWIFT_Loader::LoadLibrary('HTTP:HTTPBase');
SWIFT_Loader::LoadInterface('HTTP:HTTPAdapter', false, false);
/**
 * Curl wrapper for SWIFT_HTTP family of classes
 *
 * @author Abhinav Kumar
 */
class SWIFT_HTTPAdapter_Curl extends SWIFT_HTTPBase implements SWIFT_HTTPAdapter_Interface
{
    //Configuration Options
    /**
     * Determines whether or not the requests should follow redirects
     *
     * @var bool
     */
    private $_followRedirects = true;
    /**
     * Ascociative array of Request Headers
     *
     * @todo some refactoring to see if we can have only one Headers array
     * @var array
     */
    private $_headers = array();
    /**