Example #1
0
 public function CreateSprite(CssSprite $sprite)
 {
     if ($sprite->exists()) {
         return;
         //--- Спрайт существует
     }
     $this->LOGGER->info("Waiting to make {$sprite}");
     PsLock::lockMethod(__CLASS__, __FUNCTION__);
     try {
         if ($sprite->exists()) {
             $this->LOGGER->info('Sprite was created in another thread, skipping');
         } else {
             $this->PROFILER->start('Sprite creation');
             $this->CssSpriteGen->CreateSprite($sprite);
             $this->LOGGER->info('Sprite was successfully created, path: ' . $sprite->getCssDi()->getAbsPath());
             $this->PROFILER->stop();
         }
     } catch (Exception $ex) {
         PsLock::unlock();
         throw $ex;
     }
     PsLock::unlock();
 }