예제 #1
0
파일: HttpServer.php 프로젝트: boofw/phpole
 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;
 }
예제 #2
0
파일: Controller.php 프로젝트: boofw/phpole
 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);
     }
 }
예제 #3
0
파일: helpers.php 프로젝트: boofw/phpole
 function array_reset_key($array, $column)
 {
     return \Boofw\Phpole\Helper\Arr::resetKey($array, $column);
 }
예제 #4
0
파일: Filter.php 프로젝트: boofw/phpole
 static function add($filter, $func)
 {
     Arr::set(self::$filters, $filter, $func);
 }
예제 #5
0
파일: Input.php 프로젝트: boofw/phpole
 static function hasFile($k)
 {
     return Arr::has($_FILES, $k);
 }
예제 #6
0
파일: Session.php 프로젝트: boofw/phpole
 static function get($k, $default = null)
 {
     self::init();
     return Arr::get(self::$flash, $k, Arr::get($_SESSION, $k, $default));
 }
예제 #7
0
파일: Database.php 프로젝트: boofw/phpole
 function in($key, $values)
 {
     $values = array_unique($values);
     $r = $this->all([$key => ['$in' => $values]]);
     return Arr::sortByArray($r, $key, $values);
 }
예제 #8
0
파일: Config.php 프로젝트: boofw/phpole
 static function set($k, $v)
 {
     Arr::set(self::$config, $k, $v);
 }
예제 #9
0
파일: Cookie.php 프로젝트: boofw/phpole
 static function get($k)
 {
     return Arr::get($_COOKIE, $k);
 }