Beispiel #1
0
 /**
  * @dataProvider dataForTestUrlEncodeAndDecode
  */
 public function testUrlEncodeAndDecode($str)
 {
     $encoded = Centurion_Inflector::urlEncode($str);
     $scheme = Zend_Uri::factory();
     $scheme->setQuery($encoded);
     $this->assertEquals($str, Centurion_Inflector::urlDecode($encoded));
 }
Beispiel #2
0
 public function getSeoUrl($effects = null, $extra = false, $realPath = false)
 {
     if (is_array($effects)) {
         $effects = Media_Model_DbTable_Image::effectsArray2String($effects);
     }
     $fileId = Centurion_Inflector::urlEncode(pack("H*", $this->file_id));
     /*if (!$realPath && $this->file_id === $this->pk)
           $pk = '';
       else */
     $pk = Centurion_Inflector::urlEncode(pack("H*", $this->pk));
     $key = Centurion_Inflector::urlEncode(pack("H*", $this->getTemporaryKey($effects)));
     return $this->getDateObjectByCreatedAt()->toString('y/MM/dd/') . ($realPath ? $pk . '_' . (null !== $effects ? $effects . '_' : '_') : '') . $this->filename . ($extra ? '?' . $pk . ':' . $fileId . ':' . $key . (null !== $effects ? ':' . $effects : '') : '');
 }