Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function handle(BaseFileInterface $file, $baseUri, array $options)
 {
     $dir = sprintf('%s/%s/%s', $this->cacheDir, $this->getAlias(), md5(serialize($options)));
     $this->newPath = sprintf('%s/%s', $dir, $file->getName());
     if (!is_file($this->newPath)) {
         if (!is_dir($dir)) {
             @mkdir($dir, 0755, true);
         }
         $this->doFilter($file, $baseUri, $options);
     }
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function rename(BaseFileInterface $file)
 {
     return sprintf('%s.%s', uniqid(), ExtensionGuesser::guess($file->getContentType()));
 }
 /**
  * {@inheritDoc}
  */
 public function getUri(BaseFileInterface $baseFile)
 {
     return $baseFile->getPath();
 }