Пример #1
0
 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);
 }
Пример #2
0
 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);
     }
 }