コード例 #1
0
ファイル: Cookie.php プロジェクト: heromaeda/hayate
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #2
0
ファイル: Auth.php プロジェクト: hayate/hayate
 protected function __construct()
 {
     $this->session = Hayate_Session::getInstance();
     $this->cookie = Hayate_Cookie::getInstance();
     $this->db = Hayate_Database::getInstance();
     if ($this->session->exists(self::AUTHID)) {
         $this->identity = $this->session->get(self::AUTHID);
         $this->status = self::SUCCESS;
     } else {
         if ($this->cookie->exists(self::AUTHID)) {
             $this->identity = $this->cookie->get(self::AUTHID);
             $this->session->set(self::AUTHID, $this->identity);
             $this->status = self::SUCCESS;
         } else {
             $this->status = FALSE;
             $this->identity = NULL;
         }
     }
 }