Prado\Security\TSecurityManager::init PHP 메소드

init() 공개 메소드

The security module is registered with the application.
public init ( $config )
    public function init($config)
    {
        $this->_mbstring = extension_loaded('mbstring');
        $this->getApplication()->setSecurityManager($this);
    }

Usage Example

예제 #1
0
 public function testValidateData()
 {
     $sec = new TSecurityManager();
     $sec->init(null);
     $sec->setValidationKey('aKey');
     $sec->setValidation('SHA1');
     $hashed = $sec->hashData('A text to hash');
     self::assertEquals('A text to hash', $sec->validateData($hashed));
     // try to alter the hashed data
     $hashed[45] = "z";
     self::assertFalse($sec->validateData($hashed));
     // and a test without tampered data
     self::assertFalse($sec->validateData('bad'));
 }