1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace Mall\Framework\SearchClient\Transport;
- class HTTPException extends \Exception {
-
- protected $data = array(
- 'payload' => null,
- 'protocol' => null,
- 'port' => null,
- 'host' => null,
- 'url' => null,
- 'method' => null,
- );
-
- public function __set($key, $value) {
- if (array_key_exists($key, $this->data))
- $this->data[$key] = $value;
- }
-
- public function __get($key) {
- if (array_key_exists($key, $this->data))
- return $this->data[$key];
- else
- return false;
- }
-
- public function getCLICommand() {
- $postData = json_encode($this->payload);
- $curlCall = "curl -X{$method} 'http://{$this->host}:{$this->port}$this->url' -d '$postData'";
- return $curlCall;
- }
- }
|