Example #1
0
 /**
  * @param string $path
  * @return string
  */
 public function getDistributedUrlForPath($path)
 {
     if (empty($path)) {
         return null;
     }
     $asset = new Tx_Asdis_Domain_Model_Asset();
     $asset->setOriginalPath($path);
     $asset->setNormalizedPath($this->uriNormalizer->normalizePath($path));
     $this->distributeAsset($asset);
     return $asset->getUri();
 }
Example #2
0
 /**
  * @test
  */
 public function normalizePath()
 {
     $this->assertEquals('typo3temp/pics/foo.gif', $this->normalizer->normalizePath('/typo3temp/pics/foo.gif'));
     $this->assertEquals('typo3temp/pics/bar.gif', $this->normalizer->normalizePath('typo3temp/pics/bar.gif'));
     $this->assertEquals('typo3temp/pics/foo.png', $this->normalizer->normalizePath('//example.com/typo3temp/pics/foo.png'));
     $this->assertEquals('typo3temp/pics/bar.jpg', $this->normalizer->normalizePath('//www.example.com/typo3temp/pics/bar.jpg'));
     $this->assertEquals('typo3temp/pics/foo.png', $this->normalizer->normalizePath('http://example.com/typo3temp/pics/foo.png'));
     $this->assertEquals('typo3temp/pics/bar.jpg', $this->normalizer->normalizePath('http://www.example.com/typo3temp/pics/bar.jpg'));
 }
Example #3
0
 /**
  * @param string $originalPath
  * @return string
  */
 private function getNormalizedPath($originalPath)
 {
     return $this->uriNormalizer->normalizePath($originalPath);
 }