コード例 #1
0
ファイル: HD4.php プロジェクト: handsetdetection/php-apikit
 /**
  * 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();
 }
コード例 #2
0
 function __construct($config = array())
 {
     parent::__construct();
     $this->setConfig($config);
 }