Example #1
0
 public function __call($method, $args)
 {
     $url = (defined('PHPFOX_API_URL') ? PHPFOX_API_URL : 'http://api.phpfox.com/') . $method;
     $Http = new HTTP($url);
     $Http->auth($this->_id, $this->_key);
     if (\Phpfox::isTrial()) {
         $Http->header('PHPFOX_IS_TRIAL', '1');
     }
     $Http->using(['domain' => \Phpfox::getParam('core.path')]);
     $Http->using(['version' => \Phpfox::VERSION]);
     foreach ($args as $key => $value) {
         if (is_string($value)) {
             // $value = [$key => $value];
         }
         $Http->using($value);
     }
     return $Http->post();
 }