Exemplo n.º 1
0
 /**
  * _init
  * @return void
  */
 protected function _init()
 {
     $this->culture = Joy_Context_Culture::getInstance();
     $this->session = Joy_Context_Session::getInstance();
     $this->request = Joy_Context_Request::getInstance();
     $this->response = Joy_Context_Response::getInstance();
     $this->user = Joy_Context_User::getInstance();
     $this->cookie = Joy_Context_Cookie::getInstance();
     $this->server = Joy_Context_Server::getInstance();
     $this->models = Joy_Context_Model::getInstance();
 }
Exemplo n.º 2
0
 /**
  * getInstance
  * 
  * @return void
  */
 public static function getInstance()
 {
     if (!is_object(self::$_instance)) {
         $config = Joy_Config::getInstance();
         $session_provider = $config->application->get("application/session");
         if (null == $session_provider) {
             $session_provider = "Joy_Context_Session_Local";
         }
         $ref = new Joy_Reflection($session_provider);
         self::$_instance = $ref->newInstance();
     }
     return self::$_instance;
 }
Exemplo n.º 3
0
 public function isAuthenticated()
 {
     $session = Joy_Context_Session::getInstance();
     return (bool) $session->get("__authenticated");
 }