public function __construct($key = null) { if ($key === null) { $key = trim(file_get_contents($_SERVER['ROOT_DIR'] . '/data/secret/mailchimp-api-key')); } return parent::__construct($key); }
function __construct($config = null) { if ($config) { $secure = false; // determine where API key is if (is_array($config)) { if (isset($config['api_key'])) { $key = $config['api_key']; } else { $key = array_shift($config); } if (isset($config['secure'])) { $secure = $config['secure']; } } else { $key = $config; } $this->MCAPI = parent::__construct($key, $secure); } }