WordPress.org

Plugin Directory

Changeset 504460


Ignore:
Timestamp:
02/13/12 20:36:48 (2 years ago)
Author:
joshuabettigole
Message:

further bug fixes

Location:
contact-form-7-campaignmonitor-addon
Files:
12 edited
11 copied

Legend:

Unmodified
Added
Removed
  • contact-form-7-campaignmonitor-addon/tags/1.04/class/base_classes.php

    r503439 r504460  
    55require_once dirname(__FILE__).'/log.php'; 
    66 
    7 define('CS_REST_WRAPPER_VERSION', '1.0.10'); 
    8  
    9 define('CS_REST_WEBHOOK_FORMAT_JSON', 'json'); 
    10 define('CS_REST_WEBHOOK_FORMAT_XML', 'xml'); 
     7define('CF7CM_CS_REST_WRAPPER_VERSION', '1.0.10'); 
     8 
     9define('CF7CM_CS_REST_WEBHOOK_FORMAT_JSON', 'json'); 
     10define('CF7CM_CS_REST_WEBHOOK_FORMAT_XML', 'xml'); 
    1111 
    1212/** 
     
    1515 * 
    1616 */ 
    17 class CS_REST_Wrapper_Result { 
     17class CF7CM_CS_REST_Wrapper_Result { 
    1818    /** 
    1919     * The deserialised result of the API call 
     
    2828    var $http_status_code; 
    2929     
    30     function CS_REST_Wrapper_Result($response, $code) { 
     30    function CF7CM_CS_REST_Wrapper_Result($response, $code) { 
    3131        $this->response = $response; 
    3232        $this->http_status_code = $code; 
     
    5050 * 
    5151 */ 
    52 class CS_REST_Wrapper_Base { 
     52class CF7CM_CS_REST_Wrapper_Base { 
    5353    /** 
    5454     * The protocol to use while accessing the api 
     
    6868     * The serialiser to use for serialisation and deserialisation 
    6969     * of API request and response data 
    70      * @var CS_REST_JsonSerialiser or CS_REST_XmlSerialiser 
     70     * @var CF7CM_CS_REST_JsonSerialiser or CF7CM_CS_REST_XmlSerialiser 
    7171     * @access private 
    7272     */ 
     
    7575    /** 
    7676     * The transport to use to send API requests 
    77      * @var CS_REST_CurlTransport or CS_REST_SocketTransport or your own custom transport. 
     77     * @var CF7CM_CS_REST_CurlTransport or CF7CM_CS_REST_SocketTransport or your own custom transport. 
    7878     * @access private 
    7979     */ 
     
    8282    /** 
    8383     * The logger to use for debugging of all API requests 
    84      * @var CS_REST_Log 
     84     * @var CF7CM_CS_REST_Log 
    8585     * @access private 
    8686     */ 
     
    107107     * @param $api_key string Your api key (Ignored for get_apikey requests) 
    108108     * @param $protocol string The protocol to use for requests (http|https) 
    109      * @param $debug_level int The level of debugging required CS_REST_LOG_NONE | CS_REST_LOG_ERROR | CS_REST_LOG_WARNING | CS_REST_LOG_VERBOSE 
     109     * @param $debug_level int The level of debugging required CF7CM_CS_REST_LOG_NONE | CF7CM_CS_REST_LOG_ERROR | CF7CM_CS_REST_LOG_WARNING | CF7CM_CS_REST_LOG_VERBOSE 
    110110     * @param $host string The host to send API requests to. There is no need to change this 
    111      * @param $log CS_REST_Log The logger to use. Used for dependency injection 
     111     * @param $log CF7CM_CS_REST_Log The logger to use. Used for dependency injection 
    112112     * @param $serialiser The serialiser to use. Used for dependency injection 
    113113     * @param $transport The transport to use. Used for dependency injection 
    114114     * @access public 
    115115     */ 
    116     function CS_REST_Wrapper_Base( 
     116    function CF7CM_CS_REST_Wrapper_Base( 
    117117        $api_key, 
    118118        $protocol = 'https', 
    119         $debug_level = CS_REST_LOG_NONE, 
     119        $debug_level = CF7CM_CS_REST_LOG_NONE, 
    120120        $host = 'api.createsend.com', 
    121121        $log = NULL, 
     
    123123        $transport = NULL) { 
    124124             
    125         $this->_log = is_null($log) ? new CS_REST_Log($debug_level) : $log; 
     125        $this->_log = is_null($log) ? new CF7CM_CS_REST_Log($debug_level) : $log; 
    126126             
    127127        $this->_protocol = $protocol; 
    128128        $this->_base_route = $protocol.'://'.$host.'/api/v3/'; 
    129129 
    130         $this->_log->log_message('Creating wrapper for '.$this->_base_route, get_class($this), CS_REST_LOG_VERBOSE); 
     130        $this->_log->log_message('Creating wrapper for '.$this->_base_route, get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    131131 
    132132        $this->_transport = is_null($transport) ? 
    133             CS_REST_TRANSPORT_get_available($this->is_secure(), $this->_log) : 
     133            CF7CM_CS_REST_TRANSPORT_get_available($this->is_secure(), $this->_log) : 
    134134            $transport; 
    135135 
    136136        $transport_type = method_exists($this->_transport, 'get_type') ? $this->_transport->get_type() : 'Unknown'; 
    137         $this->_log->log_message('Using '.$transport_type.' for transport', get_class($this), CS_REST_LOG_WARNING); 
     137        $this->_log->log_message('Using '.$transport_type.' for transport', get_class($this), CF7CM_CS_REST_LOG_WARNING); 
    138138 
    139139        $this->_serialiser = is_null($serialiser) ? 
    140             CS_REST_SERIALISATION_get_available($this->_log) : $serialiser; 
    141              
    142         $this->_log->log_message('Using '.$this->_serialiser->get_type().' json serialising', get_class($this), CS_REST_LOG_WARNING); 
     140            CF7CM_CS_REST_SERIALISATION_get_available($this->_log) : $serialiser; 
     141             
     142        $this->_log->log_message('Using '.$this->_serialiser->get_type().' json serialising', get_class($this), CF7CM_CS_REST_LOG_WARNING); 
    143143 
    144144        $this->_default_call_options = array ( 
    145145            'credentials' => $api_key.':nopass', 
    146             'userAgent' => 'CS_REST_Wrapper v'.CS_REST_WRAPPER_VERSION. 
     146            'userAgent' => 'CF7CM_CS_REST_Wrapper v'.CF7CM_CS_REST_WRAPPER_VERSION. 
    147147                ' PHPv'.phpversion().' over '.$transport_type.' with '.$this->_serialiser->get_type(), 
    148148            'contentType' => 'application/json; charset=utf-8',  
     
    162162     
    163163    function put_request($route, $data, $call_options = array()) { 
    164         return $this->_call($call_options, CS_REST_PUT, $route, $data); 
     164        return $this->_call($call_options, CF7CM_CS_REST_PUT, $route, $data); 
    165165    } 
    166166     
    167167    function post_request($route, $data, $call_options = array()) { 
    168         return $this->_call($call_options, CS_REST_POST, $route, $data); 
     168        return $this->_call($call_options, CF7CM_CS_REST_POST, $route, $data); 
    169169    } 
    170170     
    171171    function delete_request($route, $call_options = array()) { 
    172         return $this->_call($call_options, CS_REST_DELETE, $route); 
     172        return $this->_call($call_options, CF7CM_CS_REST_DELETE, $route); 
    173173    } 
    174174     
    175175    function get_request($route, $call_options = array()) { 
    176         return $this->_call($call_options, CS_REST_GET, $route); 
     176        return $this->_call($call_options, CF7CM_CS_REST_GET, $route); 
    177177    } 
    178178     
     
    216216         
    217217        $call_options = array_merge($this->_default_call_options, $call_options); 
    218         $this->_log->log_message('Making '.$call_options['method'].' call to: '.$call_options['route'], get_class($this), CS_REST_LOG_WARNING); 
     218        $this->_log->log_message('Making '.$call_options['method'].' call to: '.$call_options['route'], get_class($this), CF7CM_CS_REST_LOG_WARNING); 
    219219             
    220220        $call_result = $this->_transport->make_call($call_options); 
    221221 
    222222        $this->_log->log_message('Call result: <pre>'.var_export($call_result, true).'</pre>', 
    223             get_class($this), CS_REST_LOG_VERBOSE); 
     223            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    224224 
    225225        if($call_options['deserialise']) { 
     
    227227        } 
    228228          
    229         return new CS_REST_Wrapper_Result($call_result['response'], $call_result['code']); 
     229        return new CF7CM_CS_REST_Wrapper_Result($call_result['response'], $call_result['code']); 
    230230    } 
    231231} 
  • contact-form-7-campaignmonitor-addon/tags/1.04/class/log.php

    r503439 r504460  
    11<?php 
    2 define('CS_REST_LOG_VERBOSE', 1000); 
    3 define('CS_REST_LOG_WARNING', 500); 
    4 define('CS_REST_LOG_ERROR', 250); 
    5 define('CS_REST_LOG_NONE', 0); 
     2define('CF7CM_CS_REST_LOG_VERBOSE', 1000); 
     3define('CF7CM_CS_REST_LOG_WARNING', 500); 
     4define('CF7CM_CS_REST_LOG_ERROR', 250); 
     5define('CF7CM_CS_REST_LOG_NONE', 0); 
    66 
    7 class CS_REST_Log { 
     7class CF7CM_CS_REST_Log { 
    88    var $_level; 
    99 
    10     function CS_REST_Log($level) { 
     10    function CF7CM_CS_REST_Log($level) { 
    1111        $this->_level = $level; 
    1212    } 
     
    1414    function log_message($message, $module, $level) { 
    1515        if($this->_level >= $level) { 
    16             error_log(date('G:i:s').' - '.$module.': '.$message); 
     16            error_log($module.': '.$message); 
    1717        } 
    1818    } 
  • contact-form-7-campaignmonitor-addon/tags/1.04/class/serialisation.php

    r503439 r504460  
    33require_once dirname(__FILE__).'/services_json.php'; 
    44 
    5 function CS_REST_SERIALISATION_get_available($log) {  
    6     $log->log_message('Getting serialiser', __FUNCTION__, CS_REST_LOG_VERBOSE); 
     5function CF7CM_CS_REST_SERIALISATION_get_available($log) {  
     6    $log->log_message('Getting serialiser', __FUNCTION__, CF7CM_CS_REST_LOG_VERBOSE); 
    77    if(function_exists('json_decode') && function_exists('json_encode')) { 
    8         return new CS_REST_NativeJsonSerialiser($log); 
     8        return new CF7CM_CS_REST_NativeJsonSerialiser($log); 
    99    } else { 
    10         return new CS_REST_ServicesJsonSerialiser($log); 
     10        return new CF7CM_CS_REST_ServicesJsonSerialiser($log); 
    1111    }     
    1212} 
    13 class CS_REST_BaseSerialiser { 
     13class CF7CM_CS_REST_BaseSerialiser { 
    1414 
    1515    var $_log; 
    1616     
    17     function CS_REST_BaseSerialiser($log) {  
     17    function CF7CM_CS_REST_BaseSerialiser($log) {  
    1818        $this->_log = $log; 
    1919    } 
     
    4444} 
    4545 
    46 class CS_REST_NativeJsonSerialiser extends CS_REST_BaseSerialiser { 
     46class CF7CM_CS_REST_NativeJsonSerialiser extends CF7CM_CS_REST_BaseSerialiser { 
    4747 
    48     function CS_REST_NativeJsonSerialiser($log) { 
    49         $this->CS_REST_BaseSerialiser($log); 
     48    function CF7CM_CS_REST_NativeJsonSerialiser($log) { 
     49        $this->CF7CM_CS_REST_BaseSerialiser($log); 
    5050    } 
    5151 
     
    8181} 
    8282 
    83 class CS_REST_ServicesJsonSerialiser extends CS_REST_BaseSerialiser { 
     83class CF7CM_CS_REST_ServicesJsonSerialiser extends CF7CM_CS_REST_BaseSerialiser { 
    8484     
    8585    var $_serialiser; 
    8686     
    87     function CS_REST_ServicesJsonSerialiser($log) { 
    88         $this->CS_REST_BaseSerialiser($log); 
     87    function CF7CM_CS_REST_ServicesJsonSerialiser($log) { 
     88        $this->CF7CM_CS_REST_BaseSerialiser($log); 
    8989        $this->_serialiser = new Services_JSON(); 
    9090    } 
  • contact-form-7-campaignmonitor-addon/tags/1.04/class/services_json.php

    r503439 r504460  
    5959 * Marker constant for Services_JSON::decode(), used to flag stack state 
    6060 */ 
    61 define('SERVICES_JSON_SLICE',   1); 
     61define('CF7CM_SERVICES_JSON_SLICE',   1); 
    6262 
    6363/** 
    6464 * Marker constant for Services_JSON::decode(), used to flag stack state 
    6565 */ 
    66 define('SERVICES_JSON_IN_STR',  2); 
     66define('CF7CM_SERVICES_JSON_IN_STR',  2); 
    6767 
    6868/** 
    6969 * Marker constant for Services_JSON::decode(), used to flag stack state 
    7070 */ 
    71 define('SERVICES_JSON_IN_ARR',  3); 
     71define('CF7CM_SERVICES_JSON_IN_ARR',  3); 
    7272 
    7373/** 
    7474 * Marker constant for Services_JSON::decode(), used to flag stack state 
    7575 */ 
    76 define('SERVICES_JSON_IN_OBJ',  4); 
     76define('CF7CM_SERVICES_JSON_IN_OBJ',  4); 
    7777 
    7878/** 
    7979 * Marker constant for Services_JSON::decode(), used to flag stack state 
    8080 */ 
    81 define('SERVICES_JSON_IN_CMT', 5); 
     81define('CF7CM_SERVICES_JSON_IN_CMT', 5); 
    8282 
    8383/** 
    8484 * Behavior switch for Services_JSON::decode() 
    8585 */ 
    86 define('SERVICES_JSON_LOOSE_TYPE', 16); 
     86define('CF7CM_SERVICES_JSON_LOOSE_TYPE', 16); 
    8787 
    8888/** 
    8989 * Behavior switch for Services_JSON::decode() 
    9090 */ 
    91 define('SERVICES_JSON_SUPPRESS_ERRORS', 32); 
     91define('CF7CM_SERVICES_JSON_SUPPRESS_ERRORS', 32); 
    9292 
    9393/** 
     
    112112 * </code> 
    113113 */ 
    114 class Services_JSON 
     114class CF7CM_Services_JSON 
    115115{ 
    116116   /** 
     
    130130    *                                   from encode() should be checked with isError() 
    131131    */ 
    132     function Services_JSON($use = 0) 
     132    function CF7CM_Services_JSON($use = 0) 
    133133    { 
    134134        $this->use = $use; 
     
    771771} 
    772772 
    773 class Services_JSON_Error 
     773class CF7CM_Services_JSON_Error 
    774774{ 
    775     function Services_JSON_Error($message = 'unknown error', $code = null, 
     775    function CF7CM_Services_JSON_Error($message = 'unknown error', $code = null, 
    776776                                 $mode = null, $options = null, $userinfo = null) 
    777777    { 
     
    779779    } 
    780780} 
     781     
     782?> 
  • contact-form-7-campaignmonitor-addon/tags/1.04/class/transport.php

    r503439 r504460  
    11<?php 
    22 
    3 define('CS_REST_GET', 'GET'); 
    4 define('CS_REST_POST', 'POST'); 
    5 define('CS_REST_PUT', 'PUT'); 
    6 define('CS_REST_DELETE', 'DELETE'); 
    7 define('CS_REST_SOCKET_TIMEOUT', 1); 
    8  
    9 function CS_REST_TRANSPORT_get_available($requires_ssl, $log) { 
     3define('CF7CM_CS_REST_GET', 'GET'); 
     4define('CF7CM_CS_REST_POST', 'POST'); 
     5define('CF7CM_CS_REST_PUT', 'PUT'); 
     6define('CF7CM_CS_REST_DELETE', 'DELETE'); 
     7define('CF7CM_CS_REST_SOCKET_TIMEOUT', 1); 
     8 
     9function CF7CM_CS_REST_TRANSPORT_get_available($requires_ssl, $log) { 
    1010    if(function_exists('curl_init') && function_exists('curl_exec')) { 
    11         return new CS_REST_CurlTransport($log); 
    12     } else if(CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl)) { 
    13         return new CS_REST_SocketTransport($log); 
     11        return new CF7CM_CS_REST_CurlTransport($log); 
     12    } else if(CF7CM_CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl)) { 
     13        return new CF7CM_CS_REST_SocketTransport($log); 
    1414    } else {  
    15         $log->log_message('No transport is available', __FUNCTION__, CS_REST_LOG_ERROR); 
     15        $log->log_message('No transport is available', __FUNCTION__, CF7CM_CS_REST_LOG_ERROR); 
    1616        trigger_error('No transport is available.'. 
    1717            ($requires_ssl ? ' Try using non-secure (http) mode or ' : ' Please '). 
     
    1919    }     
    2020} 
    21 function CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl) { 
     21function CF7CM_CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl) { 
    2222    if(function_exists('fsockopen')) { 
    2323        if($requires_ssl) { 
     
    3030    return false; 
    3131}    
    32 class CS_REST_BaseTransport { 
     32class CF7CM_CS_REST_BaseTransport { 
    3333     
    3434    var $_log; 
    3535     
    36     function CS_REST_BaseTransport($log) { 
     36    function CF7CM_CS_REST_BaseTransport($log) { 
    3737        $this->_log = $log; 
    3838    } 
     
    4545     
    4646            $this->_log->log_message('Inflated gzipped response: '.$original_length.' bytes ->'. 
    47                 strlen($result).' bytes', get_class(), CS_REST_LOG_VERBOSE); 
     47                strlen($result).' bytes', get_class(), CF7CM_CS_REST_LOG_VERBOSE); 
    4848        } 
    4949         
     
    5757 * @since 1.0 
    5858 */ 
    59 class CS_REST_CurlTransport extends CS_REST_BaseTransport { 
     59class CF7CM_CS_REST_CurlTransport extends CF7CM_CS_REST_BaseTransport { 
    6060 
    6161    var $_curl_zlib; 
    6262 
    63     function CS_REST_CurlTransport($log) { 
    64         $this->CS_REST_BaseTransport($log); 
     63    function CF7CM_CS_REST_CurlTransport($log) { 
     64        $this->CF7CM_CS_REST_BaseTransport($log); 
    6565         
    6666        $curl_version = curl_version(); 
     
    9090        if($this->_curl_zlib) { 
    9191            $this->_log->log_message('curl+zlib support available. Requesting gzipped response.', 
    92                 get_class($this), CS_REST_LOG_VERBOSE); 
     92                get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    9393            curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); 
    9494        } else if(function_exists('gzinflate')) { 
     
    104104 
    105105        switch($call_options['method']) { 
    106             case CS_REST_PUT: 
    107                 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CS_REST_PUT); 
     106            case CF7CM_CS_REST_PUT: 
     107                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CF7CM_CS_REST_PUT); 
    108108                $headers[] = 'Content-Length: '.strlen($call_options['data']); 
    109109                curl_setopt($ch, CURLOPT_POSTFIELDS, $call_options['data']); 
    110110                break; 
    111             case CS_REST_POST: 
     111            case CF7CM_CS_REST_POST: 
    112112                curl_setopt($ch, CURLOPT_POST, true); 
    113113                curl_setopt($ch, CURLOPT_POSTFIELDS, $call_options['data']); 
    114114                break; 
    115             case CS_REST_DELETE: 
    116                 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CS_REST_DELETE); 
     115            case CF7CM_CS_REST_DELETE: 
     116                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CF7CM_CS_REST_DELETE); 
    117117                break; 
    118118        } 
     
    125125        if(!$response && $response !== '') { 
    126126            $this->_log->log_message('Error making request with curl_error: '.curl_errno($ch), 
    127                 get_class($this), CS_REST_LOG_ERROR); 
     127                get_class($this), CF7CM_CS_REST_LOG_ERROR); 
    128128            trigger_error('Error making request with curl_error: '.curl_error($ch), E_USER_ERROR); 
    129129        } 
     
    135135            ' bytes uploaded. '.curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD).' bytes downloaded'. 
    136136            ' Total time (seconds): '.curl_getinfo($ch, CURLINFO_TOTAL_TIME),  
    137         get_class($this), CS_REST_LOG_VERBOSE); 
     137        get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    138138 
    139139        $result = array( 
     
    148148} 
    149149 
    150 class CS_REST_SocketWrapper { 
     150class CF7CM_CS_REST_SocketWrapper { 
    151151    var $socket; 
    152152 
    153153    function open($domain, $port) { 
    154         $this->socket = fsockopen($domain, $port, $errno, $errstr, CS_REST_SOCKET_TIMEOUT); 
     154        $this->socket = fsockopen($domain, $port, $errno, $errstr, CF7CM_CS_REST_SOCKET_TIMEOUT); 
    155155 
    156156        if(!$this->socket) { 
     
    158158            return false; 
    159159        } else if(function_exists('stream_set_timeout')) { 
    160             stream_set_timeout($this->socket, CS_REST_SOCKET_TIMEOUT); 
     160            stream_set_timeout($this->socket, CF7CM_CS_REST_SOCKET_TIMEOUT); 
    161161        } 
    162162 
     
    180180} 
    181181 
    182 class CS_REST_SocketTransport extends CS_REST_BaseTransport { 
     182class CF7CM_CS_REST_SocketTransport extends CF7CM_CS_REST_BaseTransport { 
    183183 
    184184    var $_socket_wrapper; 
    185185 
    186     function CS_REST_SocketTransport($log, $socket_wrapper = NULL) { 
    187         $this->CS_REST_BaseTransport($log); 
     186    function CF7CM_CS_REST_SocketTransport($log, $socket_wrapper = NULL) { 
     187        $this->CF7CM_CS_REST_BaseTransport($log); 
    188188 
    189189        if(is_null($socket_wrapper)) { 
    190             $socket_wrapper = new CS_REST_SocketWrapper(); 
     190            $socket_wrapper = new CF7CM_CS_REST_SocketWrapper(); 
    191191        } 
    192192 
     
    212212 
    213213        $this->_log->log_message('Creating socket to '.$domain.' over '.$protocol.' for request to '.$path, 
    214             get_class($this), CS_REST_LOG_VERBOSE); 
     214            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    215215 
    216216        if($protocol === 'https://') { 
     
    224224            $request = $this->_build_request($call_options, $host, $path, $inflate_response); 
    225225            $this->_log->log_message('Sending <pre>'.$request.'</pre> down the socket', 
    226             get_class($this), CS_REST_LOG_VERBOSE); 
     226            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    227227              
    228228            $this->_socket_wrapper->write($request); 
     
    233233            $call_options['route'].': '.strlen($request). 
    234234                ' bytes uploaded. '.strlen($response).' bytes downloaded',  
    235             get_class($this), CS_REST_LOG_VERBOSE); 
     235            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    236236                 
    237237            list( $headers, $result ) = $this->split_and_inflate($response, $inflate_response); 
    238238                 
    239239            $this->_log->log_message('Received headers <pre>'.$headers.'</pre>', 
    240                 get_class($this), CS_REST_LOG_VERBOSE); 
     240                get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    241241                 
    242242            return array( 
     
    250250        if (preg_match('%^\s*HTTP/1\.1 (?P<code>\d{3})%', $headers, $regs)) { 
    251251            $this->_log->log_message('Got HTTP Status Code: '.$regs['code'], 
    252             get_class($this), CS_REST_LOG_VERBOSE); 
     252            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    253253            return $regs['code']; 
    254254        } 
    255255 
    256256        $this->_log->log_message('Failed to get HTTP status code from request headers <pre>'.$headers.'</pre>', 
    257             get_class($this), CS_REST_LOG_ERROR); 
     257            get_class($this), CF7CM_CS_REST_LOG_ERROR); 
    258258        trigger_error('Failed to get HTTP status code from request', E_USER_ERROR);         
    259259    } 
  • contact-form-7-campaignmonitor-addon/tags/1.06/cf7-campaignmonitor.php

    r503440 r504460  
    66Author: Joshua Bettigole 
    77Author URI: http://www.bettigole.us 
    8 Version: 1.04 
     8Version: 1.06 
    99*/ 
    1010 
     
    2626*/ 
    2727 
    28 define( 'WPCF7_CM_VERSION', '1.04' ); 
     28define( 'WPCF7_CM_VERSION', '1.06' ); 
    2929 
    3030if ( ! defined( 'WPCF7_CM_PLUGIN_BASENAME' ) ) 
  • contact-form-7-campaignmonitor-addon/tags/1.06/class/base_classes.php

    r503438 r504460  
    55require_once dirname(__FILE__).'/log.php'; 
    66 
    7 define('CS_REST_WRAPPER_VERSION', '1.0.10'); 
    8  
    9 define('CS_REST_WEBHOOK_FORMAT_JSON', 'json'); 
    10 define('CS_REST_WEBHOOK_FORMAT_XML', 'xml'); 
     7define('CF7CM_CS_REST_WRAPPER_VERSION', '1.0.10'); 
     8 
     9define('CF7CM_CS_REST_WEBHOOK_FORMAT_JSON', 'json'); 
     10define('CF7CM_CS_REST_WEBHOOK_FORMAT_XML', 'xml'); 
    1111 
    1212/** 
     
    1515 * 
    1616 */ 
    17 class CS_REST_Wrapper_Result { 
     17class CF7CM_CS_REST_Wrapper_Result { 
    1818    /** 
    1919     * The deserialised result of the API call 
     
    2828    var $http_status_code; 
    2929     
    30     function CS_REST_Wrapper_Result($response, $code) { 
     30    function CF7CM_CS_REST_Wrapper_Result($response, $code) { 
    3131        $this->response = $response; 
    3232        $this->http_status_code = $code; 
     
    5050 * 
    5151 */ 
    52 class CS_REST_Wrapper_Base { 
     52class CF7CM_CS_REST_Wrapper_Base { 
    5353    /** 
    5454     * The protocol to use while accessing the api 
     
    6868     * The serialiser to use for serialisation and deserialisation 
    6969     * of API request and response data 
    70      * @var CS_REST_JsonSerialiser or CS_REST_XmlSerialiser 
     70     * @var CF7CM_CS_REST_JsonSerialiser or CF7CM_CS_REST_XmlSerialiser 
    7171     * @access private 
    7272     */ 
     
    7575    /** 
    7676     * The transport to use to send API requests 
    77      * @var CS_REST_CurlTransport or CS_REST_SocketTransport or your own custom transport. 
     77     * @var CF7CM_CS_REST_CurlTransport or CF7CM_CS_REST_SocketTransport or your own custom transport. 
    7878     * @access private 
    7979     */ 
     
    8282    /** 
    8383     * The logger to use for debugging of all API requests 
    84      * @var CS_REST_Log 
     84     * @var CF7CM_CS_REST_Log 
    8585     * @access private 
    8686     */ 
     
    107107     * @param $api_key string Your api key (Ignored for get_apikey requests) 
    108108     * @param $protocol string The protocol to use for requests (http|https) 
    109      * @param $debug_level int The level of debugging required CS_REST_LOG_NONE | CS_REST_LOG_ERROR | CS_REST_LOG_WARNING | CS_REST_LOG_VERBOSE 
     109     * @param $debug_level int The level of debugging required CF7CM_CS_REST_LOG_NONE | CF7CM_CS_REST_LOG_ERROR | CF7CM_CS_REST_LOG_WARNING | CF7CM_CS_REST_LOG_VERBOSE 
    110110     * @param $host string The host to send API requests to. There is no need to change this 
    111      * @param $log CS_REST_Log The logger to use. Used for dependency injection 
     111     * @param $log CF7CM_CS_REST_Log The logger to use. Used for dependency injection 
    112112     * @param $serialiser The serialiser to use. Used for dependency injection 
    113113     * @param $transport The transport to use. Used for dependency injection 
    114114     * @access public 
    115115     */ 
    116     function CS_REST_Wrapper_Base( 
     116    function CF7CM_CS_REST_Wrapper_Base( 
    117117        $api_key, 
    118118        $protocol = 'https', 
    119         $debug_level = CS_REST_LOG_NONE, 
     119        $debug_level = CF7CM_CS_REST_LOG_NONE, 
    120120        $host = 'api.createsend.com', 
    121121        $log = NULL, 
     
    123123        $transport = NULL) { 
    124124             
    125         $this->_log = is_null($log) ? new CS_REST_Log($debug_level) : $log; 
     125        $this->_log = is_null($log) ? new CF7CM_CS_REST_Log($debug_level) : $log; 
    126126             
    127127        $this->_protocol = $protocol; 
    128128        $this->_base_route = $protocol.'://'.$host.'/api/v3/'; 
    129129 
    130         $this->_log->log_message('Creating wrapper for '.$this->_base_route, get_class($this), CS_REST_LOG_VERBOSE); 
     130        $this->_log->log_message('Creating wrapper for '.$this->_base_route, get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    131131 
    132132        $this->_transport = is_null($transport) ? 
    133             CS_REST_TRANSPORT_get_available($this->is_secure(), $this->_log) : 
     133            CF7CM_CS_REST_TRANSPORT_get_available($this->is_secure(), $this->_log) : 
    134134            $transport; 
    135135 
    136136        $transport_type = method_exists($this->_transport, 'get_type') ? $this->_transport->get_type() : 'Unknown'; 
    137         $this->_log->log_message('Using '.$transport_type.' for transport', get_class($this), CS_REST_LOG_WARNING); 
     137        $this->_log->log_message('Using '.$transport_type.' for transport', get_class($this), CF7CM_CS_REST_LOG_WARNING); 
    138138 
    139139        $this->_serialiser = is_null($serialiser) ? 
    140             CS_REST_SERIALISATION_get_available($this->_log) : $serialiser; 
    141              
    142         $this->_log->log_message('Using '.$this->_serialiser->get_type().' json serialising', get_class($this), CS_REST_LOG_WARNING); 
     140            CF7CM_CS_REST_SERIALISATION_get_available($this->_log) : $serialiser; 
     141             
     142        $this->_log->log_message('Using '.$this->_serialiser->get_type().' json serialising', get_class($this), CF7CM_CS_REST_LOG_WARNING); 
    143143 
    144144        $this->_default_call_options = array ( 
    145145            'credentials' => $api_key.':nopass', 
    146             'userAgent' => 'CS_REST_Wrapper v'.CS_REST_WRAPPER_VERSION. 
     146            'userAgent' => 'CF7CM_CS_REST_Wrapper v'.CF7CM_CS_REST_WRAPPER_VERSION. 
    147147                ' PHPv'.phpversion().' over '.$transport_type.' with '.$this->_serialiser->get_type(), 
    148148            'contentType' => 'application/json; charset=utf-8',  
     
    162162     
    163163    function put_request($route, $data, $call_options = array()) { 
    164         return $this->_call($call_options, CS_REST_PUT, $route, $data); 
     164        return $this->_call($call_options, CF7CM_CS_REST_PUT, $route, $data); 
    165165    } 
    166166     
    167167    function post_request($route, $data, $call_options = array()) { 
    168         return $this->_call($call_options, CS_REST_POST, $route, $data); 
     168        return $this->_call($call_options, CF7CM_CS_REST_POST, $route, $data); 
    169169    } 
    170170     
    171171    function delete_request($route, $call_options = array()) { 
    172         return $this->_call($call_options, CS_REST_DELETE, $route); 
     172        return $this->_call($call_options, CF7CM_CS_REST_DELETE, $route); 
    173173    } 
    174174     
    175175    function get_request($route, $call_options = array()) { 
    176         return $this->_call($call_options, CS_REST_GET, $route); 
     176        return $this->_call($call_options, CF7CM_CS_REST_GET, $route); 
    177177    } 
    178178     
     
    216216         
    217217        $call_options = array_merge($this->_default_call_options, $call_options); 
    218         $this->_log->log_message('Making '.$call_options['method'].' call to: '.$call_options['route'], get_class($this), CS_REST_LOG_WARNING); 
     218        $this->_log->log_message('Making '.$call_options['method'].' call to: '.$call_options['route'], get_class($this), CF7CM_CS_REST_LOG_WARNING); 
    219219             
    220220        $call_result = $this->_transport->make_call($call_options); 
    221221 
    222222        $this->_log->log_message('Call result: <pre>'.var_export($call_result, true).'</pre>', 
    223             get_class($this), CS_REST_LOG_VERBOSE); 
     223            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    224224 
    225225        if($call_options['deserialise']) { 
     
    227227        } 
    228228          
    229         return new CS_REST_Wrapper_Result($call_result['response'], $call_result['code']); 
     229        return new CF7CM_CS_REST_Wrapper_Result($call_result['response'], $call_result['code']); 
    230230    } 
    231231} 
  • contact-form-7-campaignmonitor-addon/tags/1.06/class/log.php

    r503438 r504460  
    11<?php 
    2 define('CS_REST_LOG_VERBOSE', 1000); 
    3 define('CS_REST_LOG_WARNING', 500); 
    4 define('CS_REST_LOG_ERROR', 250); 
    5 define('CS_REST_LOG_NONE', 0); 
     2define('CF7CM_CS_REST_LOG_VERBOSE', 1000); 
     3define('CF7CM_CS_REST_LOG_WARNING', 500); 
     4define('CF7CM_CS_REST_LOG_ERROR', 250); 
     5define('CF7CM_CS_REST_LOG_NONE', 0); 
    66 
    7 class CS_REST_Log { 
     7class CF7CM_CS_REST_Log { 
    88    var $_level; 
    99 
    10     function CS_REST_Log($level) { 
     10    function CF7CM_CS_REST_Log($level) { 
    1111        $this->_level = $level; 
    1212    } 
     
    1414    function log_message($message, $module, $level) { 
    1515        if($this->_level >= $level) { 
    16             error_log(date('G:i:s').' - '.$module.': '.$message); 
     16            error_log($module.': '.$message); 
    1717        } 
    1818    } 
  • contact-form-7-campaignmonitor-addon/tags/1.06/class/serialisation.php

    r503438 r504460  
    33require_once dirname(__FILE__).'/services_json.php'; 
    44 
    5 function CS_REST_SERIALISATION_get_available($log) {  
    6     $log->log_message('Getting serialiser', __FUNCTION__, CS_REST_LOG_VERBOSE); 
     5function CF7CM_CS_REST_SERIALISATION_get_available($log) {  
     6    $log->log_message('Getting serialiser', __FUNCTION__, CF7CM_CS_REST_LOG_VERBOSE); 
    77    if(function_exists('json_decode') && function_exists('json_encode')) { 
    8         return new CS_REST_NativeJsonSerialiser($log); 
     8        return new CF7CM_CS_REST_NativeJsonSerialiser($log); 
    99    } else { 
    10         return new CS_REST_ServicesJsonSerialiser($log); 
     10        return new CF7CM_CS_REST_ServicesJsonSerialiser($log); 
    1111    }     
    1212} 
    13 class CS_REST_BaseSerialiser { 
     13class CF7CM_CS_REST_BaseSerialiser { 
    1414 
    1515    var $_log; 
    1616     
    17     function CS_REST_BaseSerialiser($log) {  
     17    function CF7CM_CS_REST_BaseSerialiser($log) {  
    1818        $this->_log = $log; 
    1919    } 
     
    4444} 
    4545 
    46 class CS_REST_NativeJsonSerialiser extends CS_REST_BaseSerialiser { 
     46class CF7CM_CS_REST_NativeJsonSerialiser extends CF7CM_CS_REST_BaseSerialiser { 
    4747 
    48     function CS_REST_NativeJsonSerialiser($log) { 
    49         $this->CS_REST_BaseSerialiser($log); 
     48    function CF7CM_CS_REST_NativeJsonSerialiser($log) { 
     49        $this->CF7CM_CS_REST_BaseSerialiser($log); 
    5050    } 
    5151 
     
    8181} 
    8282 
    83 class CS_REST_ServicesJsonSerialiser extends CS_REST_BaseSerialiser { 
     83class CF7CM_CS_REST_ServicesJsonSerialiser extends CF7CM_CS_REST_BaseSerialiser { 
    8484     
    8585    var $_serialiser; 
    8686     
    87     function CS_REST_ServicesJsonSerialiser($log) { 
    88         $this->CS_REST_BaseSerialiser($log); 
     87    function CF7CM_CS_REST_ServicesJsonSerialiser($log) { 
     88        $this->CF7CM_CS_REST_BaseSerialiser($log); 
    8989        $this->_serialiser = new Services_JSON(); 
    9090    } 
  • contact-form-7-campaignmonitor-addon/tags/1.06/class/services_json.php

    r503438 r504460  
    5959 * Marker constant for Services_JSON::decode(), used to flag stack state 
    6060 */ 
    61 define('SERVICES_JSON_SLICE',   1); 
     61define('CF7CM_SERVICES_JSON_SLICE',   1); 
    6262 
    6363/** 
    6464 * Marker constant for Services_JSON::decode(), used to flag stack state 
    6565 */ 
    66 define('SERVICES_JSON_IN_STR',  2); 
     66define('CF7CM_SERVICES_JSON_IN_STR',  2); 
    6767 
    6868/** 
    6969 * Marker constant for Services_JSON::decode(), used to flag stack state 
    7070 */ 
    71 define('SERVICES_JSON_IN_ARR',  3); 
     71define('CF7CM_SERVICES_JSON_IN_ARR',  3); 
    7272 
    7373/** 
    7474 * Marker constant for Services_JSON::decode(), used to flag stack state 
    7575 */ 
    76 define('SERVICES_JSON_IN_OBJ',  4); 
     76define('CF7CM_SERVICES_JSON_IN_OBJ',  4); 
    7777 
    7878/** 
    7979 * Marker constant for Services_JSON::decode(), used to flag stack state 
    8080 */ 
    81 define('SERVICES_JSON_IN_CMT', 5); 
     81define('CF7CM_SERVICES_JSON_IN_CMT', 5); 
    8282 
    8383/** 
    8484 * Behavior switch for Services_JSON::decode() 
    8585 */ 
    86 define('SERVICES_JSON_LOOSE_TYPE', 16); 
     86define('CF7CM_SERVICES_JSON_LOOSE_TYPE', 16); 
    8787 
    8888/** 
    8989 * Behavior switch for Services_JSON::decode() 
    9090 */ 
    91 define('SERVICES_JSON_SUPPRESS_ERRORS', 32); 
     91define('CF7CM_SERVICES_JSON_SUPPRESS_ERRORS', 32); 
    9292 
    9393/** 
     
    112112 * </code> 
    113113 */ 
    114 class Services_JSON 
     114class CF7CM_Services_JSON 
    115115{ 
    116116   /** 
     
    130130    *                                   from encode() should be checked with isError() 
    131131    */ 
    132     function Services_JSON($use = 0) 
     132    function CF7CM_Services_JSON($use = 0) 
    133133    { 
    134134        $this->use = $use; 
     
    771771} 
    772772 
    773 class Services_JSON_Error 
     773class CF7CM_Services_JSON_Error 
    774774{ 
    775     function Services_JSON_Error($message = 'unknown error', $code = null, 
     775    function CF7CM_Services_JSON_Error($message = 'unknown error', $code = null, 
    776776                                 $mode = null, $options = null, $userinfo = null) 
    777777    { 
     
    779779    } 
    780780} 
     781     
     782?> 
  • contact-form-7-campaignmonitor-addon/tags/1.06/class/transport.php

    r503438 r504460  
    11<?php 
    22 
    3 define('CS_REST_GET', 'GET'); 
    4 define('CS_REST_POST', 'POST'); 
    5 define('CS_REST_PUT', 'PUT'); 
    6 define('CS_REST_DELETE', 'DELETE'); 
    7 define('CS_REST_SOCKET_TIMEOUT', 1); 
    8  
    9 function CS_REST_TRANSPORT_get_available($requires_ssl, $log) { 
     3define('CF7CM_CS_REST_GET', 'GET'); 
     4define('CF7CM_CS_REST_POST', 'POST'); 
     5define('CF7CM_CS_REST_PUT', 'PUT'); 
     6define('CF7CM_CS_REST_DELETE', 'DELETE'); 
     7define('CF7CM_CS_REST_SOCKET_TIMEOUT', 1); 
     8 
     9function CF7CM_CS_REST_TRANSPORT_get_available($requires_ssl, $log) { 
    1010    if(function_exists('curl_init') && function_exists('curl_exec')) { 
    11         return new CS_REST_CurlTransport($log); 
    12     } else if(CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl)) { 
    13         return new CS_REST_SocketTransport($log); 
     11        return new CF7CM_CS_REST_CurlTransport($log); 
     12    } else if(CF7CM_CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl)) { 
     13        return new CF7CM_CS_REST_SocketTransport($log); 
    1414    } else {  
    15         $log->log_message('No transport is available', __FUNCTION__, CS_REST_LOG_ERROR); 
     15        $log->log_message('No transport is available', __FUNCTION__, CF7CM_CS_REST_LOG_ERROR); 
    1616        trigger_error('No transport is available.'. 
    1717            ($requires_ssl ? ' Try using non-secure (http) mode or ' : ' Please '). 
     
    1919    }     
    2020} 
    21 function CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl) { 
     21function CF7CM_CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl) { 
    2222    if(function_exists('fsockopen')) { 
    2323        if($requires_ssl) { 
     
    3030    return false; 
    3131}    
    32 class CS_REST_BaseTransport { 
     32class CF7CM_CS_REST_BaseTransport { 
    3333     
    3434    var $_log; 
    3535     
    36     function CS_REST_BaseTransport($log) { 
     36    function CF7CM_CS_REST_BaseTransport($log) { 
    3737        $this->_log = $log; 
    3838    } 
     
    4545     
    4646            $this->_log->log_message('Inflated gzipped response: '.$original_length.' bytes ->'. 
    47                 strlen($result).' bytes', get_class(), CS_REST_LOG_VERBOSE); 
     47                strlen($result).' bytes', get_class(), CF7CM_CS_REST_LOG_VERBOSE); 
    4848        } 
    4949         
     
    5757 * @since 1.0 
    5858 */ 
    59 class CS_REST_CurlTransport extends CS_REST_BaseTransport { 
     59class CF7CM_CS_REST_CurlTransport extends CF7CM_CS_REST_BaseTransport { 
    6060 
    6161    var $_curl_zlib; 
    6262 
    63     function CS_REST_CurlTransport($log) { 
    64         $this->CS_REST_BaseTransport($log); 
     63    function CF7CM_CS_REST_CurlTransport($log) { 
     64        $this->CF7CM_CS_REST_BaseTransport($log); 
    6565         
    6666        $curl_version = curl_version(); 
     
    9090        if($this->_curl_zlib) { 
    9191            $this->_log->log_message('curl+zlib support available. Requesting gzipped response.', 
    92                 get_class($this), CS_REST_LOG_VERBOSE); 
     92                get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    9393            curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); 
    9494        } else if(function_exists('gzinflate')) { 
     
    104104 
    105105        switch($call_options['method']) { 
    106             case CS_REST_PUT: 
    107                 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CS_REST_PUT); 
     106            case CF7CM_CS_REST_PUT: 
     107                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CF7CM_CS_REST_PUT); 
    108108                $headers[] = 'Content-Length: '.strlen($call_options['data']); 
    109109                curl_setopt($ch, CURLOPT_POSTFIELDS, $call_options['data']); 
    110110                break; 
    111             case CS_REST_POST: 
     111            case CF7CM_CS_REST_POST: 
    112112                curl_setopt($ch, CURLOPT_POST, true); 
    113113                curl_setopt($ch, CURLOPT_POSTFIELDS, $call_options['data']); 
    114114                break; 
    115             case CS_REST_DELETE: 
    116                 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CS_REST_DELETE); 
     115            case CF7CM_CS_REST_DELETE: 
     116                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CF7CM_CS_REST_DELETE); 
    117117                break; 
    118118        } 
     
    125125        if(!$response && $response !== '') { 
    126126            $this->_log->log_message('Error making request with curl_error: '.curl_errno($ch), 
    127                 get_class($this), CS_REST_LOG_ERROR); 
     127                get_class($this), CF7CM_CS_REST_LOG_ERROR); 
    128128            trigger_error('Error making request with curl_error: '.curl_error($ch), E_USER_ERROR); 
    129129        } 
     
    135135            ' bytes uploaded. '.curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD).' bytes downloaded'. 
    136136            ' Total time (seconds): '.curl_getinfo($ch, CURLINFO_TOTAL_TIME),  
    137         get_class($this), CS_REST_LOG_VERBOSE); 
     137        get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    138138 
    139139        $result = array( 
     
    148148} 
    149149 
    150 class CS_REST_SocketWrapper { 
     150class CF7CM_CS_REST_SocketWrapper { 
    151151    var $socket; 
    152152 
    153153    function open($domain, $port) { 
    154         $this->socket = fsockopen($domain, $port, $errno, $errstr, CS_REST_SOCKET_TIMEOUT); 
     154        $this->socket = fsockopen($domain, $port, $errno, $errstr, CF7CM_CS_REST_SOCKET_TIMEOUT); 
    155155 
    156156        if(!$this->socket) { 
     
    158158            return false; 
    159159        } else if(function_exists('stream_set_timeout')) { 
    160             stream_set_timeout($this->socket, CS_REST_SOCKET_TIMEOUT); 
     160            stream_set_timeout($this->socket, CF7CM_CS_REST_SOCKET_TIMEOUT); 
    161161        } 
    162162 
     
    180180} 
    181181 
    182 class CS_REST_SocketTransport extends CS_REST_BaseTransport { 
     182class CF7CM_CS_REST_SocketTransport extends CF7CM_CS_REST_BaseTransport { 
    183183 
    184184    var $_socket_wrapper; 
    185185 
    186     function CS_REST_SocketTransport($log, $socket_wrapper = NULL) { 
    187         $this->CS_REST_BaseTransport($log); 
     186    function CF7CM_CS_REST_SocketTransport($log, $socket_wrapper = NULL) { 
     187        $this->CF7CM_CS_REST_BaseTransport($log); 
    188188 
    189189        if(is_null($socket_wrapper)) { 
    190             $socket_wrapper = new CS_REST_SocketWrapper(); 
     190            $socket_wrapper = new CF7CM_CS_REST_SocketWrapper(); 
    191191        } 
    192192 
     
    212212 
    213213        $this->_log->log_message('Creating socket to '.$domain.' over '.$protocol.' for request to '.$path, 
    214             get_class($this), CS_REST_LOG_VERBOSE); 
     214            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    215215 
    216216        if($protocol === 'https://') { 
     
    224224            $request = $this->_build_request($call_options, $host, $path, $inflate_response); 
    225225            $this->_log->log_message('Sending <pre>'.$request.'</pre> down the socket', 
    226             get_class($this), CS_REST_LOG_VERBOSE); 
     226            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    227227              
    228228            $this->_socket_wrapper->write($request); 
     
    233233            $call_options['route'].': '.strlen($request). 
    234234                ' bytes uploaded. '.strlen($response).' bytes downloaded',  
    235             get_class($this), CS_REST_LOG_VERBOSE); 
     235            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    236236                 
    237237            list( $headers, $result ) = $this->split_and_inflate($response, $inflate_response); 
    238238                 
    239239            $this->_log->log_message('Received headers <pre>'.$headers.'</pre>', 
    240                 get_class($this), CS_REST_LOG_VERBOSE); 
     240                get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    241241                 
    242242            return array( 
     
    250250        if (preg_match('%^\s*HTTP/1\.1 (?P<code>\d{3})%', $headers, $regs)) { 
    251251            $this->_log->log_message('Got HTTP Status Code: '.$regs['code'], 
    252             get_class($this), CS_REST_LOG_VERBOSE); 
     252            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    253253            return $regs['code']; 
    254254        } 
    255255 
    256256        $this->_log->log_message('Failed to get HTTP status code from request headers <pre>'.$headers.'</pre>', 
    257             get_class($this), CS_REST_LOG_ERROR); 
     257            get_class($this), CF7CM_CS_REST_LOG_ERROR); 
    258258        trigger_error('Failed to get HTTP status code from request', E_USER_ERROR);         
    259259    } 
  • contact-form-7-campaignmonitor-addon/tags/1.06/readme.txt

    r503452 r504460  
    55Requires at least: 3.2 
    66Tested up to: 3.3.1 
    7 Stable tag: 1.04 
     7Stable tag: 1.06 
    88 
    99Add the capability to create newsletter opt-in forms with Contact Form 7. Automatically submit subscribers to predetermined lists in Campaign Monitor. 
  • contact-form-7-campaignmonitor-addon/trunk/cf7-campaignmonitor.php

    r503440 r504460  
    66Author: Joshua Bettigole 
    77Author URI: http://www.bettigole.us 
    8 Version: 1.04 
     8Version: 1.06 
    99*/ 
    1010 
     
    2626*/ 
    2727 
    28 define( 'WPCF7_CM_VERSION', '1.04' ); 
     28define( 'WPCF7_CM_VERSION', '1.06' ); 
    2929 
    3030if ( ! defined( 'WPCF7_CM_PLUGIN_BASENAME' ) ) 
  • contact-form-7-campaignmonitor-addon/trunk/class/base_classes.php

    r503438 r504460  
    55require_once dirname(__FILE__).'/log.php'; 
    66 
    7 define('CS_REST_WRAPPER_VERSION', '1.0.10'); 
    8  
    9 define('CS_REST_WEBHOOK_FORMAT_JSON', 'json'); 
    10 define('CS_REST_WEBHOOK_FORMAT_XML', 'xml'); 
     7define('CF7CM_CS_REST_WRAPPER_VERSION', '1.0.10'); 
     8 
     9define('CF7CM_CS_REST_WEBHOOK_FORMAT_JSON', 'json'); 
     10define('CF7CM_CS_REST_WEBHOOK_FORMAT_XML', 'xml'); 
    1111 
    1212/** 
     
    1515 * 
    1616 */ 
    17 class CS_REST_Wrapper_Result { 
     17class CF7CM_CS_REST_Wrapper_Result { 
    1818    /** 
    1919     * The deserialised result of the API call 
     
    2828    var $http_status_code; 
    2929     
    30     function CS_REST_Wrapper_Result($response, $code) { 
     30    function CF7CM_CS_REST_Wrapper_Result($response, $code) { 
    3131        $this->response = $response; 
    3232        $this->http_status_code = $code; 
     
    5050 * 
    5151 */ 
    52 class CS_REST_Wrapper_Base { 
     52class CF7CM_CS_REST_Wrapper_Base { 
    5353    /** 
    5454     * The protocol to use while accessing the api 
     
    6868     * The serialiser to use for serialisation and deserialisation 
    6969     * of API request and response data 
    70      * @var CS_REST_JsonSerialiser or CS_REST_XmlSerialiser 
     70     * @var CF7CM_CS_REST_JsonSerialiser or CF7CM_CS_REST_XmlSerialiser 
    7171     * @access private 
    7272     */ 
     
    7575    /** 
    7676     * The transport to use to send API requests 
    77      * @var CS_REST_CurlTransport or CS_REST_SocketTransport or your own custom transport. 
     77     * @var CF7CM_CS_REST_CurlTransport or CF7CM_CS_REST_SocketTransport or your own custom transport. 
    7878     * @access private 
    7979     */ 
     
    8282    /** 
    8383     * The logger to use for debugging of all API requests 
    84      * @var CS_REST_Log 
     84     * @var CF7CM_CS_REST_Log 
    8585     * @access private 
    8686     */ 
     
    107107     * @param $api_key string Your api key (Ignored for get_apikey requests) 
    108108     * @param $protocol string The protocol to use for requests (http|https) 
    109      * @param $debug_level int The level of debugging required CS_REST_LOG_NONE | CS_REST_LOG_ERROR | CS_REST_LOG_WARNING | CS_REST_LOG_VERBOSE 
     109     * @param $debug_level int The level of debugging required CF7CM_CS_REST_LOG_NONE | CF7CM_CS_REST_LOG_ERROR | CF7CM_CS_REST_LOG_WARNING | CF7CM_CS_REST_LOG_VERBOSE 
    110110     * @param $host string The host to send API requests to. There is no need to change this 
    111      * @param $log CS_REST_Log The logger to use. Used for dependency injection 
     111     * @param $log CF7CM_CS_REST_Log The logger to use. Used for dependency injection 
    112112     * @param $serialiser The serialiser to use. Used for dependency injection 
    113113     * @param $transport The transport to use. Used for dependency injection 
    114114     * @access public 
    115115     */ 
    116     function CS_REST_Wrapper_Base( 
     116    function CF7CM_CS_REST_Wrapper_Base( 
    117117        $api_key, 
    118118        $protocol = 'https', 
    119         $debug_level = CS_REST_LOG_NONE, 
     119        $debug_level = CF7CM_CS_REST_LOG_NONE, 
    120120        $host = 'api.createsend.com', 
    121121        $log = NULL, 
     
    123123        $transport = NULL) { 
    124124             
    125         $this->_log = is_null($log) ? new CS_REST_Log($debug_level) : $log; 
     125        $this->_log = is_null($log) ? new CF7CM_CS_REST_Log($debug_level) : $log; 
    126126             
    127127        $this->_protocol = $protocol; 
    128128        $this->_base_route = $protocol.'://'.$host.'/api/v3/'; 
    129129 
    130         $this->_log->log_message('Creating wrapper for '.$this->_base_route, get_class($this), CS_REST_LOG_VERBOSE); 
     130        $this->_log->log_message('Creating wrapper for '.$this->_base_route, get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    131131 
    132132        $this->_transport = is_null($transport) ? 
    133             CS_REST_TRANSPORT_get_available($this->is_secure(), $this->_log) : 
     133            CF7CM_CS_REST_TRANSPORT_get_available($this->is_secure(), $this->_log) : 
    134134            $transport; 
    135135 
    136136        $transport_type = method_exists($this->_transport, 'get_type') ? $this->_transport->get_type() : 'Unknown'; 
    137         $this->_log->log_message('Using '.$transport_type.' for transport', get_class($this), CS_REST_LOG_WARNING); 
     137        $this->_log->log_message('Using '.$transport_type.' for transport', get_class($this), CF7CM_CS_REST_LOG_WARNING); 
    138138 
    139139        $this->_serialiser = is_null($serialiser) ? 
    140             CS_REST_SERIALISATION_get_available($this->_log) : $serialiser; 
    141              
    142         $this->_log->log_message('Using '.$this->_serialiser->get_type().' json serialising', get_class($this), CS_REST_LOG_WARNING); 
     140            CF7CM_CS_REST_SERIALISATION_get_available($this->_log) : $serialiser; 
     141             
     142        $this->_log->log_message('Using '.$this->_serialiser->get_type().' json serialising', get_class($this), CF7CM_CS_REST_LOG_WARNING); 
    143143 
    144144        $this->_default_call_options = array ( 
    145145            'credentials' => $api_key.':nopass', 
    146             'userAgent' => 'CS_REST_Wrapper v'.CS_REST_WRAPPER_VERSION. 
     146            'userAgent' => 'CF7CM_CS_REST_Wrapper v'.CF7CM_CS_REST_WRAPPER_VERSION. 
    147147                ' PHPv'.phpversion().' over '.$transport_type.' with '.$this->_serialiser->get_type(), 
    148148            'contentType' => 'application/json; charset=utf-8',  
     
    162162     
    163163    function put_request($route, $data, $call_options = array()) { 
    164         return $this->_call($call_options, CS_REST_PUT, $route, $data); 
     164        return $this->_call($call_options, CF7CM_CS_REST_PUT, $route, $data); 
    165165    } 
    166166     
    167167    function post_request($route, $data, $call_options = array()) { 
    168         return $this->_call($call_options, CS_REST_POST, $route, $data); 
     168        return $this->_call($call_options, CF7CM_CS_REST_POST, $route, $data); 
    169169    } 
    170170     
    171171    function delete_request($route, $call_options = array()) { 
    172         return $this->_call($call_options, CS_REST_DELETE, $route); 
     172        return $this->_call($call_options, CF7CM_CS_REST_DELETE, $route); 
    173173    } 
    174174     
    175175    function get_request($route, $call_options = array()) { 
    176         return $this->_call($call_options, CS_REST_GET, $route); 
     176        return $this->_call($call_options, CF7CM_CS_REST_GET, $route); 
    177177    } 
    178178     
     
    216216         
    217217        $call_options = array_merge($this->_default_call_options, $call_options); 
    218         $this->_log->log_message('Making '.$call_options['method'].' call to: '.$call_options['route'], get_class($this), CS_REST_LOG_WARNING); 
     218        $this->_log->log_message('Making '.$call_options['method'].' call to: '.$call_options['route'], get_class($this), CF7CM_CS_REST_LOG_WARNING); 
    219219             
    220220        $call_result = $this->_transport->make_call($call_options); 
    221221 
    222222        $this->_log->log_message('Call result: <pre>'.var_export($call_result, true).'</pre>', 
    223             get_class($this), CS_REST_LOG_VERBOSE); 
     223            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    224224 
    225225        if($call_options['deserialise']) { 
     
    227227        } 
    228228          
    229         return new CS_REST_Wrapper_Result($call_result['response'], $call_result['code']); 
     229        return new CF7CM_CS_REST_Wrapper_Result($call_result['response'], $call_result['code']); 
    230230    } 
    231231} 
  • contact-form-7-campaignmonitor-addon/trunk/class/log.php

    r503438 r504460  
    11<?php 
    2 define('CS_REST_LOG_VERBOSE', 1000); 
    3 define('CS_REST_LOG_WARNING', 500); 
    4 define('CS_REST_LOG_ERROR', 250); 
    5 define('CS_REST_LOG_NONE', 0); 
     2define('CF7CM_CS_REST_LOG_VERBOSE', 1000); 
     3define('CF7CM_CS_REST_LOG_WARNING', 500); 
     4define('CF7CM_CS_REST_LOG_ERROR', 250); 
     5define('CF7CM_CS_REST_LOG_NONE', 0); 
    66 
    7 class CS_REST_Log { 
     7class CF7CM_CS_REST_Log { 
    88    var $_level; 
    99 
    10     function CS_REST_Log($level) { 
     10    function CF7CM_CS_REST_Log($level) { 
    1111        $this->_level = $level; 
    1212    } 
     
    1414    function log_message($message, $module, $level) { 
    1515        if($this->_level >= $level) { 
    16             error_log(date('G:i:s').' - '.$module.': '.$message); 
     16            error_log($module.': '.$message); 
    1717        } 
    1818    } 
  • contact-form-7-campaignmonitor-addon/trunk/class/serialisation.php

    r503438 r504460  
    33require_once dirname(__FILE__).'/services_json.php'; 
    44 
    5 function CS_REST_SERIALISATION_get_available($log) {  
    6     $log->log_message('Getting serialiser', __FUNCTION__, CS_REST_LOG_VERBOSE); 
     5function CF7CM_CS_REST_SERIALISATION_get_available($log) {  
     6    $log->log_message('Getting serialiser', __FUNCTION__, CF7CM_CS_REST_LOG_VERBOSE); 
    77    if(function_exists('json_decode') && function_exists('json_encode')) { 
    8         return new CS_REST_NativeJsonSerialiser($log); 
     8        return new CF7CM_CS_REST_NativeJsonSerialiser($log); 
    99    } else { 
    10         return new CS_REST_ServicesJsonSerialiser($log); 
     10        return new CF7CM_CS_REST_ServicesJsonSerialiser($log); 
    1111    }     
    1212} 
    13 class CS_REST_BaseSerialiser { 
     13class CF7CM_CS_REST_BaseSerialiser { 
    1414 
    1515    var $_log; 
    1616     
    17     function CS_REST_BaseSerialiser($log) {  
     17    function CF7CM_CS_REST_BaseSerialiser($log) {  
    1818        $this->_log = $log; 
    1919    } 
     
    4444} 
    4545 
    46 class CS_REST_NativeJsonSerialiser extends CS_REST_BaseSerialiser { 
     46class CF7CM_CS_REST_NativeJsonSerialiser extends CF7CM_CS_REST_BaseSerialiser { 
    4747 
    48     function CS_REST_NativeJsonSerialiser($log) { 
    49         $this->CS_REST_BaseSerialiser($log); 
     48    function CF7CM_CS_REST_NativeJsonSerialiser($log) { 
     49        $this->CF7CM_CS_REST_BaseSerialiser($log); 
    5050    } 
    5151 
     
    8181} 
    8282 
    83 class CS_REST_ServicesJsonSerialiser extends CS_REST_BaseSerialiser { 
     83class CF7CM_CS_REST_ServicesJsonSerialiser extends CF7CM_CS_REST_BaseSerialiser { 
    8484     
    8585    var $_serialiser; 
    8686     
    87     function CS_REST_ServicesJsonSerialiser($log) { 
    88         $this->CS_REST_BaseSerialiser($log); 
     87    function CF7CM_CS_REST_ServicesJsonSerialiser($log) { 
     88        $this->CF7CM_CS_REST_BaseSerialiser($log); 
    8989        $this->_serialiser = new Services_JSON(); 
    9090    } 
  • contact-form-7-campaignmonitor-addon/trunk/class/services_json.php

    r503438 r504460  
    5959 * Marker constant for Services_JSON::decode(), used to flag stack state 
    6060 */ 
    61 define('SERVICES_JSON_SLICE',   1); 
     61define('CF7CM_SERVICES_JSON_SLICE',   1); 
    6262 
    6363/** 
    6464 * Marker constant for Services_JSON::decode(), used to flag stack state 
    6565 */ 
    66 define('SERVICES_JSON_IN_STR',  2); 
     66define('CF7CM_SERVICES_JSON_IN_STR',  2); 
    6767 
    6868/** 
    6969 * Marker constant for Services_JSON::decode(), used to flag stack state 
    7070 */ 
    71 define('SERVICES_JSON_IN_ARR',  3); 
     71define('CF7CM_SERVICES_JSON_IN_ARR',  3); 
    7272 
    7373/** 
    7474 * Marker constant for Services_JSON::decode(), used to flag stack state 
    7575 */ 
    76 define('SERVICES_JSON_IN_OBJ',  4); 
     76define('CF7CM_SERVICES_JSON_IN_OBJ',  4); 
    7777 
    7878/** 
    7979 * Marker constant for Services_JSON::decode(), used to flag stack state 
    8080 */ 
    81 define('SERVICES_JSON_IN_CMT', 5); 
     81define('CF7CM_SERVICES_JSON_IN_CMT', 5); 
    8282 
    8383/** 
    8484 * Behavior switch for Services_JSON::decode() 
    8585 */ 
    86 define('SERVICES_JSON_LOOSE_TYPE', 16); 
     86define('CF7CM_SERVICES_JSON_LOOSE_TYPE', 16); 
    8787 
    8888/** 
    8989 * Behavior switch for Services_JSON::decode() 
    9090 */ 
    91 define('SERVICES_JSON_SUPPRESS_ERRORS', 32); 
     91define('CF7CM_SERVICES_JSON_SUPPRESS_ERRORS', 32); 
    9292 
    9393/** 
     
    112112 * </code> 
    113113 */ 
    114 class Services_JSON 
     114class CF7CM_Services_JSON 
    115115{ 
    116116   /** 
     
    130130    *                                   from encode() should be checked with isError() 
    131131    */ 
    132     function Services_JSON($use = 0) 
     132    function CF7CM_Services_JSON($use = 0) 
    133133    { 
    134134        $this->use = $use; 
     
    771771} 
    772772 
    773 class Services_JSON_Error 
     773class CF7CM_Services_JSON_Error 
    774774{ 
    775     function Services_JSON_Error($message = 'unknown error', $code = null, 
     775    function CF7CM_Services_JSON_Error($message = 'unknown error', $code = null, 
    776776                                 $mode = null, $options = null, $userinfo = null) 
    777777    { 
     
    779779    } 
    780780} 
     781     
     782?> 
  • contact-form-7-campaignmonitor-addon/trunk/class/transport.php

    r503438 r504460  
    11<?php 
    22 
    3 define('CS_REST_GET', 'GET'); 
    4 define('CS_REST_POST', 'POST'); 
    5 define('CS_REST_PUT', 'PUT'); 
    6 define('CS_REST_DELETE', 'DELETE'); 
    7 define('CS_REST_SOCKET_TIMEOUT', 1); 
    8  
    9 function CS_REST_TRANSPORT_get_available($requires_ssl, $log) { 
     3define('CF7CM_CS_REST_GET', 'GET'); 
     4define('CF7CM_CS_REST_POST', 'POST'); 
     5define('CF7CM_CS_REST_PUT', 'PUT'); 
     6define('CF7CM_CS_REST_DELETE', 'DELETE'); 
     7define('CF7CM_CS_REST_SOCKET_TIMEOUT', 1); 
     8 
     9function CF7CM_CS_REST_TRANSPORT_get_available($requires_ssl, $log) { 
    1010    if(function_exists('curl_init') && function_exists('curl_exec')) { 
    11         return new CS_REST_CurlTransport($log); 
    12     } else if(CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl)) { 
    13         return new CS_REST_SocketTransport($log); 
     11        return new CF7CM_CS_REST_CurlTransport($log); 
     12    } else if(CF7CM_CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl)) { 
     13        return new CF7CM_CS_REST_SocketTransport($log); 
    1414    } else {  
    15         $log->log_message('No transport is available', __FUNCTION__, CS_REST_LOG_ERROR); 
     15        $log->log_message('No transport is available', __FUNCTION__, CF7CM_CS_REST_LOG_ERROR); 
    1616        trigger_error('No transport is available.'. 
    1717            ($requires_ssl ? ' Try using non-secure (http) mode or ' : ' Please '). 
     
    1919    }     
    2020} 
    21 function CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl) { 
     21function CF7CM_CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl) { 
    2222    if(function_exists('fsockopen')) { 
    2323        if($requires_ssl) { 
     
    3030    return false; 
    3131}    
    32 class CS_REST_BaseTransport { 
     32class CF7CM_CS_REST_BaseTransport { 
    3333     
    3434    var $_log; 
    3535     
    36     function CS_REST_BaseTransport($log) { 
     36    function CF7CM_CS_REST_BaseTransport($log) { 
    3737        $this->_log = $log; 
    3838    } 
     
    4545     
    4646            $this->_log->log_message('Inflated gzipped response: '.$original_length.' bytes ->'. 
    47                 strlen($result).' bytes', get_class(), CS_REST_LOG_VERBOSE); 
     47                strlen($result).' bytes', get_class(), CF7CM_CS_REST_LOG_VERBOSE); 
    4848        } 
    4949         
     
    5757 * @since 1.0 
    5858 */ 
    59 class CS_REST_CurlTransport extends CS_REST_BaseTransport { 
     59class CF7CM_CS_REST_CurlTransport extends CF7CM_CS_REST_BaseTransport { 
    6060 
    6161    var $_curl_zlib; 
    6262 
    63     function CS_REST_CurlTransport($log) { 
    64         $this->CS_REST_BaseTransport($log); 
     63    function CF7CM_CS_REST_CurlTransport($log) { 
     64        $this->CF7CM_CS_REST_BaseTransport($log); 
    6565         
    6666        $curl_version = curl_version(); 
     
    9090        if($this->_curl_zlib) { 
    9191            $this->_log->log_message('curl+zlib support available. Requesting gzipped response.', 
    92                 get_class($this), CS_REST_LOG_VERBOSE); 
     92                get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    9393            curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); 
    9494        } else if(function_exists('gzinflate')) { 
     
    104104 
    105105        switch($call_options['method']) { 
    106             case CS_REST_PUT: 
    107                 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CS_REST_PUT); 
     106            case CF7CM_CS_REST_PUT: 
     107                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CF7CM_CS_REST_PUT); 
    108108                $headers[] = 'Content-Length: '.strlen($call_options['data']); 
    109109                curl_setopt($ch, CURLOPT_POSTFIELDS, $call_options['data']); 
    110110                break; 
    111             case CS_REST_POST: 
     111            case CF7CM_CS_REST_POST: 
    112112                curl_setopt($ch, CURLOPT_POST, true); 
    113113                curl_setopt($ch, CURLOPT_POSTFIELDS, $call_options['data']); 
    114114                break; 
    115             case CS_REST_DELETE: 
    116                 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CS_REST_DELETE); 
     115            case CF7CM_CS_REST_DELETE: 
     116                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CF7CM_CS_REST_DELETE); 
    117117                break; 
    118118        } 
     
    125125        if(!$response && $response !== '') { 
    126126            $this->_log->log_message('Error making request with curl_error: '.curl_errno($ch), 
    127                 get_class($this), CS_REST_LOG_ERROR); 
     127                get_class($this), CF7CM_CS_REST_LOG_ERROR); 
    128128            trigger_error('Error making request with curl_error: '.curl_error($ch), E_USER_ERROR); 
    129129        } 
     
    135135            ' bytes uploaded. '.curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD).' bytes downloaded'. 
    136136            ' Total time (seconds): '.curl_getinfo($ch, CURLINFO_TOTAL_TIME),  
    137         get_class($this), CS_REST_LOG_VERBOSE); 
     137        get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    138138 
    139139        $result = array( 
     
    148148} 
    149149 
    150 class CS_REST_SocketWrapper { 
     150class CF7CM_CS_REST_SocketWrapper { 
    151151    var $socket; 
    152152 
    153153    function open($domain, $port) { 
    154         $this->socket = fsockopen($domain, $port, $errno, $errstr, CS_REST_SOCKET_TIMEOUT); 
     154        $this->socket = fsockopen($domain, $port, $errno, $errstr, CF7CM_CS_REST_SOCKET_TIMEOUT); 
    155155 
    156156        if(!$this->socket) { 
     
    158158            return false; 
    159159        } else if(function_exists('stream_set_timeout')) { 
    160             stream_set_timeout($this->socket, CS_REST_SOCKET_TIMEOUT); 
     160            stream_set_timeout($this->socket, CF7CM_CS_REST_SOCKET_TIMEOUT); 
    161161        } 
    162162 
     
    180180} 
    181181 
    182 class CS_REST_SocketTransport extends CS_REST_BaseTransport { 
     182class CF7CM_CS_REST_SocketTransport extends CF7CM_CS_REST_BaseTransport { 
    183183 
    184184    var $_socket_wrapper; 
    185185 
    186     function CS_REST_SocketTransport($log, $socket_wrapper = NULL) { 
    187         $this->CS_REST_BaseTransport($log); 
     186    function CF7CM_CS_REST_SocketTransport($log, $socket_wrapper = NULL) { 
     187        $this->CF7CM_CS_REST_BaseTransport($log); 
    188188 
    189189        if(is_null($socket_wrapper)) { 
    190             $socket_wrapper = new CS_REST_SocketWrapper(); 
     190            $socket_wrapper = new CF7CM_CS_REST_SocketWrapper(); 
    191191        } 
    192192 
     
    212212 
    213213        $this->_log->log_message('Creating socket to '.$domain.' over '.$protocol.' for request to '.$path, 
    214             get_class($this), CS_REST_LOG_VERBOSE); 
     214            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    215215 
    216216        if($protocol === 'https://') { 
     
    224224            $request = $this->_build_request($call_options, $host, $path, $inflate_response); 
    225225            $this->_log->log_message('Sending <pre>'.$request.'</pre> down the socket', 
    226             get_class($this), CS_REST_LOG_VERBOSE); 
     226            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    227227              
    228228            $this->_socket_wrapper->write($request); 
     
    233233            $call_options['route'].': '.strlen($request). 
    234234                ' bytes uploaded. '.strlen($response).' bytes downloaded',  
    235             get_class($this), CS_REST_LOG_VERBOSE); 
     235            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    236236                 
    237237            list( $headers, $result ) = $this->split_and_inflate($response, $inflate_response); 
    238238                 
    239239            $this->_log->log_message('Received headers <pre>'.$headers.'</pre>', 
    240                 get_class($this), CS_REST_LOG_VERBOSE); 
     240                get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    241241                 
    242242            return array( 
     
    250250        if (preg_match('%^\s*HTTP/1\.1 (?P<code>\d{3})%', $headers, $regs)) { 
    251251            $this->_log->log_message('Got HTTP Status Code: '.$regs['code'], 
    252             get_class($this), CS_REST_LOG_VERBOSE); 
     252            get_class($this), CF7CM_CS_REST_LOG_VERBOSE); 
    253253            return $regs['code']; 
    254254        } 
    255255 
    256256        $this->_log->log_message('Failed to get HTTP status code from request headers <pre>'.$headers.'</pre>', 
    257             get_class($this), CS_REST_LOG_ERROR); 
     257            get_class($this), CF7CM_CS_REST_LOG_ERROR); 
    258258        trigger_error('Failed to get HTTP status code from request', E_USER_ERROR);         
    259259    } 
  • contact-form-7-campaignmonitor-addon/trunk/readme.txt

    r503452 r504460  
    55Requires at least: 3.2 
    66Tested up to: 3.3.1 
    7 Stable tag: 1.04 
     7Stable tag: 1.06 
    88 
    99Add the capability to create newsletter opt-in forms with Contact Form 7. Automatically submit subscribers to predetermined lists in Campaign Monitor. 
Note: See TracChangeset for help on using the changeset viewer.