本文整理匯總了PHP中Library::before方法的典型用法代碼示例。如果您正苦於以下問題:PHP Library::before方法的具體用法?PHP Library::before怎麽用?PHP Library::before使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Library
的用法示例。
在下文中一共展示了Library::before方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: before
public function before()
{
$this->nocversion = 'none';
$path = $this->request->route->path;
if ($path != 'auth/login') {
$this->check_license($path);
}
parent::before();
//$auth = Auth::instance();
//Auth::instance()->login('hrvoje','hajduk81');
/*
if(!$this->check_license())
\Response::redirect(\Config::get('base_url').'/ajax/license');
*/
$uri_string = explode('/', Uri::string());
if (count($uri_string) > 1 and $uri_string[0] == 'auth' and $uri_string[1] == 'login') {
return;
}
if ($path != '_root_') {
if (\Sentry::check()) {
$this->user = Sentry::user()->get('id');
$this->username = Sentry::user()->get('username');
return;
} else {
$this->user = false;
$this->username = '';
\Response::redirect(\Config::get('base_url') . 'auth/login');
}
}
}
示例2: before
public function before()
{
//remove all data from previus installation....
Sentry::logout();
Config::load('Sentry', true);
Cookie::delete('sentry_rm');
Session::delete(Config::get('sentry.session.user'));
Session::delete(Config::get('sentry.session.provider'));
parent::before();
}