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; } } }
function allow($pattern, $action) { so_query::ensure($pattern); if ($this->check($pattern->uri, $action)) { return $this; } $this->storage[] = array('so_permit_pattern' => (string) $pattern, 'so_permit_action' => (string) $action); unset($this->list); return $this; }
static function start($package, $mode = 'dev') { register_shutdown_function(array(get_class(), 'finalize')); ob_start(); so_error::monitor(); foreach (parse_ini_file(so_file::make('php.ini')) as $key => $value) { ini_set($key, $value); } so_page::$mode = $mode; so_package::$defaultName = $package; so_query::$resourcePrefix = $package; $front = so_front::make(); $query = $front->uri->query; $resource = $query->resource; $uriStandard = $resource->uri; if ($query->uri != $uriStandard) { return static::$response = so_output::moved((string) $uriStandard); } static::$response = $resource->execute($front->method, $front->data); }
function uri_make() { return so_query::make(array('subscriber;list', 'for' => (string) $this->subject))->uri; }
function uri_make() { return so_query::make(array('console'))->uri; }
function query_store($data) { return so_query::make($data); }
function uri_make() { return so_query::make(array('article;list'))->uri; }
function uri_make() { return so_query::make(array('article;list', 'author' => (string) $this->author->name))->uri; }
static function hash() { $data = func_get_args(); $key = sha1(so_query::make($data)); return $key; }
function uri_make() { return so_query::make(array('image' => $this->id))->uri; }
function uri_make() { return so_query::make(array('phpinfo'))->uri; }
function uri_make() { return so_query::make(array('image', 'search' => $this->search))->uri; }
function match($subject) { so_query::ensure($subject); $iterP = $this->getIterator(); $iterS = $subject->getIterator(); while (true) { if (!$iterP->valid()) { return !$iterS->valid(); } if (!$iterS->valid()) { return false; } if ($iterP->key() !== $iterS->key()) { return false; } if ($iterP->current()) { if ($iterP->current() !== $iterS->current()) { return false; } } $iterP->next(); $iterS->next(); } }
function uri_make() { return so_query::make(array('search' => $this->text))->uri; }
function uri_make() { return so_query::make(array('author' => $this->name))->uri; }