getIdsByTag() public static method

public static getIdsByTag ( $tag ) : array
$tag
return array
Ejemplo n.º 1
0
 /**
  *
  */
 public static function processOptimizeQueue()
 {
     $ids = TmpStore::getIdsByTag("image-optimize-queue");
     // id = path of image relative to PIMCORE_TEMPORARY_DIRECTORY
     foreach ($ids as $id) {
         $file = PIMCORE_TEMPORARY_DIRECTORY . "/" . $id;
         if (file_exists($file)) {
             $originalFilesize = filesize($file);
             \Pimcore\Image\Optimizer::optimize($file);
             \Logger::debug("Optimized image: " . $file . " saved " . formatBytes($originalFilesize - filesize($file)));
         } else {
             \Logger::debug("Skip optimizing of " . $file . " because it doesn't exist anymore");
         }
         TmpStore::delete($id);
     }
 }