@@ -112,7 +112,7 @@ |
||
| 112 | 112 | }exit; |
| 113 | 113 | |
| 114 | 114 | /**/ |
| 115 | - $this->eventDispatcher->addListener(KernelEvents::TERMINATE, function (EventDispatcher $event) use ($mapping, $media) { |
|
| 115 | + $this->eventDispatcher->addListener(KernelEvents::TERMINATE, function(EventDispatcher $event) use ($mapping, $media) { |
|
| 116 | 116 | |
| 117 | 117 | $this->generateCache($media); |
| 118 | 118 | }); |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | echo 'wait for jpg :'.PHP_EOL; |
| 83 | 83 | echo $event->getPeriods()[$period++]->getDuration().PHP_EOL; |
| 84 | 84 | |
| 85 | - foreach ($filters as $filter) { |
|
| 85 | + foreach ($filters as $filter) { |
|
| 86 | 86 | $this->imgToWebP($media, $filter); |
| 87 | 87 | //$this->storeImageInCache($pathWebP, $binary, $filter); liip not optimized... |
| 88 | 88 | } |
@@ -58,16 +58,16 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | /**/ |
| 61 | - $i=0; |
|
| 61 | + $i = 0; |
|
| 62 | 62 | foreach ($filters as $filter) { |
| 63 | 63 | ++$i; |
| 64 | 64 | //$this->storeImageInCache($path, $binary, $filter); |
| 65 | 65 | /**/ |
| 66 | 66 | // this is a bit quicker but less optimized (more CPU usage and more Threads) => |
| 67 | - ${'process' . $i} = new Process([$this->projectDir.'/bin/console', 'liip:imagine:cache:resolve "'.$path.'" --force --filter='.$filter]); |
|
| 67 | + ${'process'.$i} = new Process([$this->projectDir.'/bin/console', 'liip:imagine:cache:resolve "'.$path.'" --force --filter='.$filter]); |
|
| 68 | 68 | //.' >/dev/null 2>&1 &'); |
| 69 | - ${'process' . $i}->disableOutput(); |
|
| 70 | - ${'process' . $i}->start(); |
|
| 69 | + ${'process'.$i}->disableOutput(); |
|
| 70 | + ${'process'.$i}->start(); |
|
| 71 | 71 | /**/ |
| 72 | 72 | } |
| 73 | 73 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | echo 'init process for jpg filters :'.PHP_EOL; |
| 76 | 76 | echo $event->getPeriods()[$period++]->getDuration().PHP_EOL; |
| 77 | 77 | |
| 78 | - for ($j = 1; $j < $i; $j++) { ${'process' . $j}->wait(); } /**/ |
|
| 78 | + for ($j = 1; $j < $i; $j++) { ${'process'.$j}->wait(); } /**/ |
|
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | $event = $this->stopWatch->lap('fdb'); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $webPConverterOptions = self::$webPConverterOptions; |
| 170 | 170 | $projectDir = $this->projectDir; |
| 171 | 171 | //var_dump($path); exit; |
| 172 | - $this->pool->add(function () use ($projectDir, $path, $pathJpg, $pathWebP, $webPConverterOptions, $filter) { |
|
| 172 | + $this->pool->add(function() use ($projectDir, $path, $pathJpg, $pathWebP, $webPConverterOptions, $filter) { |
|
| 173 | 173 | // took 46s (vs 43s) to add liip generation in async |
| 174 | 174 | //exec($projectDir.'/bin/console liip:imagine:cache:resolve "'.$path.'" --force --filter='.$filter.' >/dev/null 2>&1 &'); |
| 175 | 175 | self::imgToWebPStatic($pathJpg, $pathWebP, $webPConverterOptions, $filter); |