Пример #1
0
            if (($value = $this->router->request(new http\request($uri, 'GET', $request->protocol, $get), $global)) !== null) {
                $result[$param] = $value;
            }
        }
        return $result;
    }
    private static function substitute($string, $vars)
    {
        $vars = new readonly((object) $vars);
        return preg_replace_callback('/\\{@([\\w\\.]+)\\}/', function ($matches) use($vars) {
            return $vars[$matches[1]];
        }, $string);
    }
    static $success;
    static $error;
    private $batch;
    private $schema;
    private $documentation;
    private $vars;
    private $schemas = [];
    private $resolve = null;
    private $router;
    private $dispatcher;
    private $encoders = [];
}
www::$success = function ($content) {
    return www::encode($content);
};
www::$error = function ($e) {
    return www::encode(['type' => $e->type, 'description' => $e->description, 'stacktrace' => $e->getTrace()]);
};
Пример #2
0
    }
    function get($url, $params = [])
    {
        return $this->call('GET', $url, '*', $params);
    }
    function post($url, $post = [], $get = [])
    {
        return $this->call('POST', $url, '*', $get, $post);
    }
    function variable($name)
    {
        return isset($this->vars[$name]) ? $this->vars[$name] : "[Variable not found: {$name}]";
    }
    static $success;
    static $error;
    private $encoders = [];
    private $vars = [];
    private $methods = [];
    private $domains = [];
    private $dispatcher;
    private $folders = [];
    private $batch = null;
    private $schema = null;
    private $documentation = null;
}
www::$success = function ($content) {
    return www::encode(['status' => 'success', 'content' => $content]);
};
www::$error = function ($type, $message) {
    return www::encode(['status' => 'error', 'type' => $type, 'message' => $message]);
};