示例#1
0
 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#2
0
 public function start(Zend_Db_Adapter_Abstract $database)
 {
     $this->_database = $database;
     require_once 'Sitengine/Permiso/Audit.php';
     $this->_audit = new Sitengine_Permiso_Audit($this, $database);
     require_once 'Sitengine/Permiso/Directory.php';
     $this->_directory = new Sitengine_Permiso_Directory($this, $database);
     require_once 'Sitengine/Permiso/Acl.php';
     $this->_acl = new Sitengine_Permiso_Acl($this);
     require_once 'Sitengine/Permiso/Dac.php';
     $this->_dac = new Sitengine_Permiso_Dac($this);
     require_once 'Sitengine/Permiso/Model/Account.php';
     $this->_account = Sitengine_Permiso_Model_Account::getInstance($this);
     $this->_account->setTranslator($this->getModelTranslator());
     require_once 'Sitengine/Auth.php';
     $this->_auth = Sitengine_Auth::getInstance();
     require_once 'Sitengine/Auth/Storage/Session.php';
     $this->_auth->setStorage(new Sitengine_Auth_Storage_Session('Sitengine_Permiso_User', 'username'));
     require_once 'Sitengine/Auth/Adapter/DbTable.php';
     $this->_authAdapter = new Sitengine_Auth_Adapter_DbTable($database);
     return $this;
 }