コード例 #1
0
ファイル: Request.php プロジェクト: watoki/deli
 public function toString()
 {
     return json_encode(array('context' => $this->context->toString(), 'target' => $this->target->toString(), 'method' => $this->method, 'arguments' => $this->arguments->toArray()));
 }
コード例 #2
0
ファイル: Url.php プロジェクト: watoki/curir
 public function toString()
 {
     $queries = array();
     foreach ($this->flattenParams($this->parameters) as $key => $value) {
         $queries[] = $key . '=' . urlencode($value);
     }
     $port = $this->port ? self::PORT_SEPARATOR . $this->port : '';
     $scheme = $this->scheme ? $this->scheme . self::SCHEME_SEPARATOR : '';
     $server = $this->host && $this->isAbsolute() ? $scheme . self::HOST_PREFIX . $this->host . $port : '';
     return $server . parent::toString() . ($queries ? self::QUERY_STRING_SEPARATOR . implode('&', $queries) : '') . ($this->fragment ? self::FRAGMENT_SEPARATOR . $this->fragment : '');
 }