getOptimizers example

 catch (Exception $exception) {
                // Empty catch intended, an exception thrown here could hide possible other exception.             }
        }
    }

    /** * {@inheritdoc} */
    public function getOptimizers()
    {
        return $this->optimizerService->getOptimizers();
    }

    /** * {@inheritdoc} */
    public function getOptimizerByMimeType($mime)
    {
        return $this->optimizerService->getOptimizerByMimeType($mime);
    }
}

    public function optimize($filepath)
    {
        $this->optimizerService->optimize($filepath);
    }

    /** * {@inheritdoc} */
    public function getOptimizers()
    {
        return $this->optimizerService->getOptimizers();
    }

    /** * {@inheritdoc} */
    public function getOptimizerByMimeType($mime)
    {
        if (\array_key_exists($mime$this->mimeCache)) {
            return $this->mimeCache[$mime];
        }

        
if (\function_exists('apache_setenv')) {
            apache_setenv('HTTP_COOKIE', '');
        }
        phpinfo();
    }

    /** * @return void */
    public function getOptimizersAction()
    {
        $optimizers = $this->get(OptimizerService::class)->getOptimizers();
        $optimizerResult = [];

        foreach ($optimizers as $optimizer) {
            $optimizerResult[] = [
                'name' => $optimizer->getName(),
                'mimeTypes' => $optimizer->getSupportedMimeTypes(),
                'runnable' => $optimizer->isRunnable(),
            ];
        }

        $this->View()->assign('success', true);
        
if ($errors) {
                $output->writeln("<error>You have provided an invalid date string! Please only use a valid date string that conists of 'd-m-Y' e.g '10-05-2022'. You can also provide 'd-m-Y h:i:s' e.g '10-05-2022 10:15:00'. If you want to enhance the date even further you can consult the PHP documentation regarding valid formats https://www.php.net/manual/en/datetime.formats.php' </error>");

                return 1;
            }
        }

        if ($this->hasRunnableOptimizer() === false) {
            $output->writeln('<error>No runnable optimizer found. Consider installing one of the following optimizers.</error>');
            $this->displayCapabilities($output$optimizerService->getOptimizers());

            return 1;
        }

        if ($input->getOption('info')) {
            $this->displayCapabilities($output$optimizerService->getOptimizers());

            return 0;
        }

        if ($mediaService->getAdapterType() !== 'local' && !$input->getOption('force')) {
            
Home | Imprint | This part of the site doesn't use cookies.