1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Merge pull request #871 from elmariachi111/patch-1

XCache cannot be flushed on the CLI -> for pretty much the same reason as APC
This commit is contained in:
Benjamin Eberlei 2013-12-16 15:47:09 -08:00
commit ad9366a1fc
3 changed files with 16 additions and 1 deletions

View File

@ -24,6 +24,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Cache\ApcCache; use Doctrine\Common\Cache\ApcCache;
use Doctrine\Common\Cache\XcacheCache;
/** /**
* Command to clear the metadata cache of the various cache drivers. * Command to clear the metadata cache of the various cache drivers.
@ -88,6 +89,11 @@ EOT
throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI."); throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
} }
if ($cacheDriver instanceof XcacheCache) {
throw new \LogicException("Cannot clear XCache Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
}
$output->writeln('Clearing ALL Metadata cache entries'); $output->writeln('Clearing ALL Metadata cache entries');
$result = $cacheDriver->deleteAll(); $result = $cacheDriver->deleteAll();

View File

@ -24,6 +24,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Cache\ApcCache; use Doctrine\Common\Cache\ApcCache;
use Doctrine\Common\Cache\XcacheCache;
/** /**
* Command to clear the query cache of the various cache drivers. * Command to clear the query cache of the various cache drivers.
@ -87,6 +88,9 @@ EOT
if ($cacheDriver instanceof ApcCache) { if ($cacheDriver instanceof ApcCache) {
throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI."); throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
} }
if ($cacheDriver instanceof XcacheCache) {
throw new \LogicException("Cannot clear XCache Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
}
$output->write('Clearing ALL Query cache entries' . PHP_EOL); $output->write('Clearing ALL Query cache entries' . PHP_EOL);

View File

@ -24,6 +24,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Cache\ApcCache; use Doctrine\Common\Cache\ApcCache;
use Doctrine\Common\Cache\XcacheCache;
/** /**
* Command to clear the result cache of the various cache drivers. * Command to clear the result cache of the various cache drivers.
@ -88,6 +89,10 @@ EOT
throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI."); throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
} }
if ($cacheDriver instanceof XcacheCache) {
throw new \LogicException("Cannot clear XCache Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
}
$output->writeln('Clearing ALL Result cache entries'); $output->writeln('Clearing ALL Result cache entries');
$result = $cacheDriver->deleteAll(); $result = $cacheDriver->deleteAll();