First Commit

This commit is contained in:
marco
2026-09-01 10:46:29 -03:00
commit bf96b77e9c
10000 changed files with 3508600 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Console\Commands;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class OpcacheClearCommand extends Command
{
protected static $defaultName = 'opcache:clear';
protected static $defaultDescription = 'Limpa o cache do OPcache (PHP)';
protected function configure(): void
{
$this->setHelp('Este comando executa a função opcache_reset() para invalidar todo o cache de bytecode.');
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
if (!function_exists('opcache_reset')) {
$output->writeln('<error>OPcache não está habilitado ou a função opcache_reset() não está disponível.</error>');
return Command::FAILURE;
}
if (opcache_reset()) {
$output->writeln('<info>OPcache limpo com sucesso!</info>');
return Command::SUCCESS;
}
$output->writeln('<error>Falha ao limpar o OPcache.</error>');
return Command::FAILURE;
}
}