当前位置: 首页>>代码示例>>PHP>>正文


PHP Utils::token方法代码示例

本文整理汇总了PHP中Utils::token方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils::token方法的具体用法?PHP Utils::token怎么用?PHP Utils::token使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils的用法示例。


在下文中一共展示了Utils::token方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: boot

 public function boot()
 {
     $this->request = core('request');
     $this->response = core('response');
     core('registry')->set('app.controller', $this);
     $this->csrf = Utils::token();
     session('front')->setCsrf($this->csrf);
 }
开发者ID:schpill,项目名称:standalone,代码行数:8,代码来源:controller.php

示例2: __construct

 public function __construct()
 {
     $this->token = Session::instance('ThinSession')->getAuthToken();
     if (is_null($this->token)) {
         $this->token = Utils::token();
         Session::instance('ThinSession')->setAuthToken($this->token);
     }
 }
开发者ID:schpill,项目名称:thin,代码行数:8,代码来源:Auth.php

示例3: __construct

 public function __construct($values = array())
 {
     if (is_object($values)) {
         $values = $values->assoc();
     }
     if (count($values)) {
         $this->values = $this->make($values);
     } else {
         $this->values = $values;
     }
     $this->_token = Utils::token();
 }
开发者ID:noikiy,项目名称:inovi,代码行数:12,代码来源:Container.php

示例4: __construct

 public function __construct($ns, $store = 'Thin\\Store')
 {
     $ns = 'thin_' . $ns;
     $c = cookies()->{$ns};
     if (null === $c) {
         setcookie($ns, Utils::token(), strtotime('+1 year'));
     } else {
         setcookie($ns, $c, strtotime('+1 year'));
     }
     $this->key = cookies()->{$ns};
     if (empty($this->key)) {
         throw new Exception("Cookies must be functional to execute this class.");
     }
     $this->model($ns);
     $this->db = new $store('thin_forever_' . $ns);
     $this->fetch();
 }
开发者ID:schpill,项目名称:thin,代码行数:17,代码来源:Forever.php

示例5: refreshRememberToken

 /**
  * Refresh the "remember me" token for the user.
  *
  * @return void
  */
 protected function refreshRememberToken($user)
 {
     $user->setToken($token = Utils::token())->save();
 }
开发者ID:schpill,项目名称:standalone,代码行数:9,代码来源:auth.php

示例6: has

 public function has($key)
 {
     $check = Utils::token();
     return $check != $this->get($key, $check);
 }
开发者ID:schpill,项目名称:thin,代码行数:5,代码来源:Globalstore.php

示例7: token

 public static function token()
 {
     return static::input('hidden', '_token', Utils::token());
 }
开发者ID:noikiy,项目名称:inovi,代码行数:4,代码来源:Form.php

示例8: container

    {
        return container()->qbm($name);
    }
    public function truncate($str, $length = 20)
    {
        if (strlen($str) > $length) {
            $str = substr($str, 0, $length) . '…';
        }
        return $str;
    }
}
$test = new Quickdata('test');
$i = 0;
$max = 0;
while ($i++ < $max) {
    $test->create()->setName(Utils::token())->setPrice(rand(500, 15000))->save();
}
$error = null;
$dbAuth = container()->qbm('qma_auth');
// $dbAuth->create()->setLogin('gplusquellec')->setPassword(sha1('230266gp'))->save();
$session = session('qma');
$auth = $session->getAuth();
$isAuth = !is_null($auth);
if (false === $isAuth && true === context()->isPost()) {
    $login = $request->getLogin();
    $password = $request->getPassword();
    if (!is_null($login) && !is_null($password)) {
        $count = $dbAuth->where("login = {$login}")->where('password = ' . sha1($password))->count();
        if (0 < $count) {
            $isAuth = true;
            $session->setAuth($isAuth);
开发者ID:noikiy,项目名称:inovi,代码行数:31,代码来源:qma.php

示例9: __isset

 public function __isset($key)
 {
     $check = Utils::token();
     return $check != isake($this->_data, $key, $check);
 }
开发者ID:schpill,项目名称:standalone,代码行数:5,代码来源:Repository.php

示例10: generateSessionId

 /**
  * Get a new, random session ID.
  *
  * @return string
  */
 protected function generateSessionId()
 {
     return sha1(uniqid('', true) . Utils::token() . microtime(true));
 }
开发者ID:schpill,项目名称:standalone,代码行数:9,代码来源:session.php

示例11: flush

 private function flush()
 {
     $item = array('insert' => Utils::token());
     $this->dbItem->push($item);
     return $this;
 }
开发者ID:schpill,项目名称:thin,代码行数:6,代码来源:Rediseav.php


注:本文中的Utils::token方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。