rainlab / mailchimp-plugin

Provides MailChimp integration services
MIT License
11 stars 16 forks source link

MCAPI.class.php PHP 7 Compatibility #14

Closed furqanfreed closed 7 years ago

furqanfreed commented 8 years ago

PHP 4 style constructors Deprecated in PHP 7.0.x

so update

function MCAPI($apikey, $secure=false) {
        $this->secure = $secure;
        $this->apiUrl = parse_url("http://api.mailchimp.com/" . $this->version . "/?output=php");
        $this->api_key = $apikey;
    }

TO:

function __construct($apikey, $secure=false) {
        $this->secure = $secure;
        $this->apiUrl = parse_url("http://api.mailchimp.com/" . $this->version . "/?output=php");
        $this->api_key = $apikey;
    }
LukeTowers commented 7 years ago

Perhaps we should switch to using https://bitbucket.org/mailchimp/mailchimp-api-php

marcoelho97 commented 7 years ago

@daftspunk That little MCAPI function was preventing all users in my website from subscribing... :( Started getting an error when I went to a new server.. image

LukeTowers commented 7 years ago

@marcoelho97 apply the fix from develop, I'll talk to @daftspunk about pushing a new update to the marketplace.