Inheritance: implements Zend_Filter_Encrypt_Interface
 /**
  * Ensures that the filter allows de/encryption with compression
  *
  * @return void
  */
 public function testEncryptionWithDecryptionAndCompressionMcrypt()
 {
     if (!extension_loaded('bz2')) {
         $this->markTestSkipped('This adapter needs the bz2 extension');
     }
     $filter = new Zend_Filter_Encrypt_Mcrypt(array('key' => 'testkey'));
     $filter->setVector('testvect');
     $filter->setCompression('bz2');
     $output = $filter->encrypt('teststring');
     $this->assertNotEquals('teststring', $output);
     $input = $filter->decrypt($output);
     $this->assertEquals('teststring', trim($input));
 }
Exemple #2
0
 /**
  * _srand() interception
  *
  * @see ZF-8742
  */
 protected function _srand()
 {
     if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
         return;
     }
     if (!self::$_srandCalled) {
         srand((double) microtime() * 1000000);
         self::$_srandCalled = true;
     }
 }
 /**
  * _srand() interception
  *
  * @see ZF-8742
  */
 protected function _srand()
 {
     if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
         return;
     }
     if (!self::$_srandCalled) {
         srand(Zend_Crypt_Math::randInteger(0, PHP_INT_MAX));
         self::$_srandCalled = true;
     }
 }