本文整理汇总了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);
}
示例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);
}
}
示例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();
}
示例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();
}
示例5: refreshRememberToken
/**
* Refresh the "remember me" token for the user.
*
* @return void
*/
protected function refreshRememberToken($user)
{
$user->setToken($token = Utils::token())->save();
}
示例6: has
public function has($key)
{
$check = Utils::token();
return $check != $this->get($key, $check);
}
示例7: token
public static function token()
{
return static::input('hidden', '_token', Utils::token());
}
示例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);
示例9: __isset
public function __isset($key)
{
$check = Utils::token();
return $check != isake($this->_data, $key, $check);
}
示例10: generateSessionId
/**
* Get a new, random session ID.
*
* @return string
*/
protected function generateSessionId()
{
return sha1(uniqid('', true) . Utils::token() . microtime(true));
}
示例11: flush
private function flush()
{
$item = array('insert' => Utils::token());
$this->dbItem->push($item);
return $this;
}