/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/AssetMapper/Compressor/ZopfliCompressor.php
48 строк
1 KB
Alexandre Daubois
[AssetMapper] Fix missing return type
06 дек 2024, 17:18
06 дек 2024, 17:18
99737f9
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\AssetMapper\Compressor; use Symfony\Component\Process\Process; /** * Compresses a file using zopfli. * * @author Kévin Dunglas <kevin@dunglas.dev> */ final class ZopfliCompressor implements SupportedCompressorInterface { use CompressorTrait; private const WRAPPER = ''; // not supported yet https://github.com/kjdev/php-ext-zopfli/issues/23 private const COMMAND = 'zopfli'; private const PHP_EXTENSION = ''; private const FILE_EXTENSION = 'gz'; public function __construct( ?string $executable = null, ) { $this->executable = $executable; } private function compressWithBinary(string $path): void { (new Process([$this->executable, '--', $path]))->mustRun(); } /** * @return resource */ private function createStreamContext() { throw new \BadMethodCallException('Extension is not supported yet.'); } }