Пример #1
0
 /**
  * Creates the target cache path.
  *
  * @param string                     $path
  * @param ResizeCoordinatesInterface $coordinates
  *
  * @return string The realtive target path
  */
 private function createCachePath($path, ResizeCoordinatesInterface $coordinates)
 {
     $pathinfo = pathinfo($path);
     $hash = substr(md5(implode('|', [$path, filemtime($path), $coordinates->getHash()])), 0, 9);
     return substr($hash, 0, 1) . '/' . $pathinfo['filename'] . '-' . substr($hash, 1) . '.' . $pathinfo['extension'];
 }