當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。