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
 function array_reset_key($array, $column)
 {
     return \Boofw\Phpole\Helper\Arr::resetKey($array, $column);
 }
Ejemplo n.º 4
0
 static function add($filter, $func)
 {
     Arr::set(self::$filters, $filter, $func);
 }
Ejemplo n.º 5
0
 static function hasFile($k)
 {
     return Arr::has($_FILES, $k);
 }
Ejemplo n.º 6
0
 static function get($k, $default = null)
 {
     self::init();
     return Arr::get(self::$flash, $k, Arr::get($_SESSION, $k, $default));
 }
Ejemplo n.º 7
0
 function in($key, $values)
 {
     $values = array_unique($values);
     $r = $this->all([$key => ['$in' => $values]]);
     return Arr::sortByArray($r, $key, $values);
 }
Ejemplo n.º 8
0
 static function set($k, $v)
 {
     Arr::set(self::$config, $k, $v);
 }
Ejemplo n.º 9
0
 static function get($k)
 {
     return Arr::get($_COOKIE, $k);
 }