コード例 #1
0
ファイル: DirectAdmin.php プロジェクト: omines/directadmin
 /**
  * Invokes the DirectAdmin API with specific options.
  *
  * @param string $method HTTP method to use (ie. GET or POST)
  * @param string $command DirectAdmin API command to invoke
  * @param array $options Guzzle options to use for the call
  * @return array The unvalidated response
  * @throws DirectAdminException If anything went wrong on the network level
  */
 public function invoke($method, $command, $options = [])
 {
     $result = $this->rawRequest($method, '/CMD_API_' . $command, $options);
     if (!empty($result['error'])) {
         throw new DirectAdminException("{$method} to {$command} failed: {$result['details']} ({$result['text']})");
     }
     return Conversion::sanitizeArray($result);
 }