Exemplo n.º 1
0
 /**
  * This is the main constructor for the class HD4
  *
  * @param mixed $config can be an array of config options or a fully qualified path to an alternate config file.
  * @return void
  */
 function __construct($config = null)
 {
     parent::__construct();
     $this->setConfig($config);
     if (empty($this->config['username'])) {
         throw new \Exception('Error : API username not set. Download a premade config from your Site Settings.');
     } elseif (empty($this->config['secret'])) {
         throw new \Exception('Error : API secret not set. Download a premade config from your Site Settings.');
     }
     if (!empty($this->config['use_local']) && !class_exists('ZipArchive')) {
         throw new \Exception('Ultimate detection needs ZipArchive to unzip archive files. Please install this php module.');
     }
     $this->setup();
 }
Exemplo n.º 2
0
 function __construct($config = array())
 {
     parent::__construct();
     $this->setConfig($config);
 }