예제 #1
0
파일: mysql.php 프로젝트: how/openpasl
 public function setDSN($dsn)
 {
     if (!$this->driver) {
         $this->driver = DB::singleton($dsn);
     }
 }
예제 #2
0
파일: RBAC.php 프로젝트: how/openpasl
 public function init($dsn)
 {
     ORM::registerDB('pasl_rbac', DB::factory($dsn));
 }
예제 #3
0
파일: DBTest.php 프로젝트: how/openpasl
 public function testPASLDriverGetInstance()
 {
     $dbDriver = \PASL\DB::singleton($this->strMyDsn, false, false);
     $this->assertIsA($dbDriver, 'PASL\\DB_Driver\\common');
     $this->assertIsA($dbDriver, 'PASL\\DB_Driver\\mysql');
     $dbDriverCmp = \PASL\DB::getInstance($this->aMyDsn['phptype'] . '_' . $this->aMyDsn['hostspec']);
     $this->assertIdentical($dbDriver, $dbDriverCmp);
 }
예제 #4
0
 function TestAuth_mysql_bad_password()
 {
     $db = \PASL\DB::singleton($this->strMyDsn);
     $oAuth = new \PASL\Authentication('mysql');
     /**
      * @var PASL_Authentication_Provider_mysql
      */
     $authProvider = $oAuth->getProvider();
     $authProvider->setDriver($db);
     $authProvider->setEncryption('none');
     $authProvider->setQuery('SELECT * FROM `pasl_authentication_tests` WHERE `username`="%s" LIMIT 1');
     $this->assertFalse($oAuth->authenticate($this->aBadPassword));
     $oErr = $oAuth->getError();
     $this->assertEqual($oErr, PASL_AUTH_BAD_PASSWORD);
 }