Ejemplo n.º 1
0
 static function makeToken($appId)
 {
     $appKey = Arr::get(self::$keys, $appId);
     $post = $_POST;
     $token = sha1($appId . $appKey . $post['api'] . $post['func'] . md5(json_encode($post['arguments'])));
     return $token;
 }
Ejemplo n.º 2
0
 static function run()
 {
     $c = self::newInstance();
     if ($c instanceof self) {
         $a = 'get' . ucfirst(Route::$action);
         if (Arr::get($_SERVER, 'REQUEST_METHOD') === 'POST') {
             $a = 'post' . ucfirst(Route::$action);
         }
         $c->filter($a);
         echo $c->{$a}();
     } else {
         throw new HttpException(404);
     }
 }
Ejemplo n.º 3
0
 static function run($filter)
 {
     self::init();
     $func = Arr::get(self::$filters, $filter);
     return $func();
 }
Ejemplo n.º 4
0
 static function file($k)
 {
     return Arr::get($_FILES, $k);
 }
Ejemplo n.º 5
0
 static function get($k, $default = null)
 {
     self::init();
     return Arr::get(self::$flash, $k, Arr::get($_SESSION, $k, $default));
 }
Ejemplo n.º 6
0
 static function get($k, $v = null)
 {
     return Arr::get(self::$config, $k, $v);
 }
Ejemplo n.º 7
0
 static function get($k)
 {
     return Arr::get($_COOKIE, $k);
 }