예제 #1
0
 /**
  * @return Acl
  */
 public static function instance()
 {
     if (self::$_instance === null) {
         self::$_instance = new Acl();
     }
     return self::$_instance;
 }
예제 #2
0
파일: acl.php 프로젝트: RaoHai/picpic
 public static function getInstance()
 {
     if (is_null(self::$_instance) || !isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
 /**
  * init instance
  * order rights object to set roles ,resources, allow, deny
  * $identity must have $identity->id and $identity->role
  * 
  * $rights must have methods:
  * set_roles
  * set_resources
  * set_allow
  * set_deny
  *
  * @param Identity $identity
  * @param Rights $rights
  * @return Acl
  */
 public static function init($identity, $rights)
 {
     // create instance
     if (self::$_instance == false) {
         self::$_instance = new Acl($identity, $rights);
     }
     // return data
     return self::$_instance;
 }