Base::exists PHP Method

exists() public method

Return TRUE if hive key is set (or return timestamp and TTL if cached)
public exists ( $key, &$val = NULL ) : boolean
$key string
$val mixed
return boolean
    function exists($key, &$val = NULL)
    {
        $val = $this->ref($key, FALSE);
        return isset($val) ? TRUE : (Cache::instance()->exists($this->hash($key) . '.var', $val) ?: FALSE);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * perform external authorisation, return access token
  * @param null $callback_url
  * @return array|bool
  */
 public function login($callback_url = NULL)
 {
     if (!$this->f3->exists('GET.oauth_token')) {
         $tokens = $this->requestToken();
         $this->setAuthToken($tokens['oauth_token'], $tokens['oauth_token_secret']);
         if (is_null($callback_url)) {
             $callback_url = $this->f3->get('SCHEME') . '://' . $this->f3->get('HOST') . $this->f3->get('URI');
         }
         $this->authorize($callback_url);
     } else {
         return $this->accessToken();
     }
 }
All Usage Examples Of Base::exists