Esempio n. 1
0
 function data_make()
 {
     switch ($this->method) {
         case 'get':
         case 'head':
             return null;
         case 'post':
             $data = $_POST;
             foreach ($_FILES as $key => $info) {
                 $data[$key] = so_file::make($info['tmp_name']);
             }
             return so_query::make($data);
         default:
             $raw = '';
             $input = fopen('php://input', 'r');
             while ($chunk = fread($input, 1024)) {
                 $raw .= $chunk;
             }
             fclose($input);
             $type = preg_replace('~;.*$~', '', so_value::make($_SERVER['CONTENT_TYPE']) ?: '');
             switch ($type) {
                 case 'application/x-www-form-urlencoded':
                     return so_query::make($raw);
                     break;
                 case 'text/xml':
                 case 'application/xml':
                     return so_dom::make($raw);
                 case 'text/json':
                 case 'application/json':
                     return json_decode($raw);
                 default:
                     return $raw;
             }
     }
 }
Esempio n. 2
0
 function uri_make()
 {
     return so_query::make(array('subscriber;list', 'for' => (string) $this->subject))->uri;
 }
Esempio n. 3
0
 function uri_make()
 {
     return so_query::make(array('console'))->uri;
 }
Esempio n. 4
0
 function query_store($data)
 {
     return so_query::make($data);
 }
Esempio n. 5
0
 function uri_make()
 {
     return so_query::make(array('article;list'))->uri;
 }
Esempio n. 6
0
 static function hash()
 {
     $data = func_get_args();
     $key = sha1(so_query::make($data));
     return $key;
 }
 function uri_make()
 {
     return so_query::make(array('article;list', 'author' => (string) $this->author->name))->uri;
 }
Esempio n. 8
0
 function uri_make()
 {
     return so_query::make(array('phpinfo'))->uri;
 }
Esempio n. 9
0
 function uri_make()
 {
     return so_query::make(array('image' => $this->id))->uri;
 }
Esempio n. 10
0
 function uri_make()
 {
     return so_query::make(array('image', 'search' => $this->search))->uri;
 }
Esempio n. 11
0
 function struct_store($data)
 {
     $struct = array();
     foreach ($data as $key => $value) {
         $value = (string) $value;
         if (is_int($key)) {
             $struct += so_query::make($value)->struct;
         } else {
             $struct[$key] = $value;
         }
     }
     return $struct;
 }
Esempio n. 12
0
 function uri_make()
 {
     return so_query::make(array('search' => $this->text))->uri;
 }
Esempio n. 13
0
 function uri_make()
 {
     return so_query::make(array('author' => $this->name))->uri;
 }
Esempio n. 14
0
 function uri_make()
 {
     return so_query::make(array('permit;list', 'for' => (string) $this->owner))->uri;
 }