1
0
mirror of synced 2025-02-01 04:51:45 +03:00

DDC-611 - Throw an exception if trying to clear an APC Cache from the CLI since there is no access to the webserver shared memory (thanks Romain Dalmaso for reporting)

This commit is contained in:
Benjamin Eberlei 2010-06-28 23:36:09 +02:00
parent 321fc2506d
commit afd4121116
3 changed files with 12 additions and 0 deletions

View File

@ -66,6 +66,10 @@ EOT
throw new \InvalidArgumentException('No Metadata cache driver is configured on given EntityManager.');
}
if ($cacheDriver instanceof \Doctrine\Common\Cache\ApcCache) {
throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
}
$output->write('Clearing ALL Metadata cache entries' . PHP_EOL);
$cacheIds = $cacheDriver->deleteAll();

View File

@ -66,6 +66,10 @@ EOT
throw new \InvalidArgumentException('No Query cache driver is configured on given EntityManager.');
}
if ($cacheDriver instanceof \Doctrine\Common\Cache\ApcCache) {
throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
}
$output->write('Clearing ALL Query cache entries' . PHP_EOL);
$cacheIds = $cacheDriver->deleteAll();

View File

@ -84,6 +84,10 @@ EOT
throw new \InvalidArgumentException('No Result cache driver is configured on given EntityManager.');
}
if ($cacheDriver instanceof \Doctrine\Common\Cache\ApcCache) {
throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
}
$outputed = false;
// Removing based on --id