Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixes DDC-1396.

  • Loading branch information...
commit 8efae0b232210b27200f2709e7fcb24c7f02c5de 1 parent cd28051
Guilherme Blanco authored October 03, 2011
7  lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php
@@ -21,7 +21,8 @@
21 21
 
22 22
 use Symfony\Component\Console\Input\InputArgument,
23 23
     Symfony\Component\Console\Input\InputOption,
24  
-    Symfony\Component\Console;
  24
+    Symfony\Component\Console,
  25
+    Doctrine\Common\Cache;
25 26
 
26 27
 /**
27 28
  * Command to clear the metadata cache of the various cache drivers.
@@ -83,6 +84,10 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
83 84
         if ( ! $cacheDriver) {
84 85
             throw new \InvalidArgumentException('No Metadata cache driver is configured on given EntityManager.');
85 86
         }
  87
+        
  88
+        if ($cacheDriver instanceof Cache\ApcCache) {
  89
+            throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
  90
+        }
86 91
 
87 92
         $output->write('Clearing ALL Metadata cache entries' . PHP_EOL);
88 93
 
7  lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php
@@ -21,7 +21,8 @@
21 21
 
22 22
 use Symfony\Component\Console\Input\InputArgument,
23 23
     Symfony\Component\Console\Input\InputOption,
24  
-    Symfony\Component\Console;
  24
+    Symfony\Component\Console,
  25
+    Doctrine\Common\Cache;
25 26
 
26 27
 /**
27 28
  * Command to clear the query cache of the various cache drivers.
@@ -83,6 +84,10 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
83 84
         if ( ! $cacheDriver) {
84 85
             throw new \InvalidArgumentException('No Query cache driver is configured on given EntityManager.');
85 86
         }
  87
+        
  88
+        if ($cacheDriver instanceof Cache\ApcCache) {
  89
+            throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
  90
+        }
86 91
 
87 92
         $output->write('Clearing ALL Query cache entries' . PHP_EOL);
88 93
 
7  lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php
@@ -21,7 +21,8 @@
21 21
 
22 22
 use Symfony\Component\Console\Input\InputArgument,
23 23
     Symfony\Component\Console\Input\InputOption,
24  
-    Symfony\Component\Console;
  24
+    Symfony\Component\Console,
  25
+    Doctrine\Common\Cache;
25 26
 
26 27
 /**
27 28
  * Command to clear the result cache of the various cache drivers.
@@ -83,6 +84,10 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
83 84
         if ( ! $cacheDriver) {
84 85
             throw new \InvalidArgumentException('No Result cache driver is configured on given EntityManager.');
85 86
         }
  87
+        
  88
+        if ($cacheDriver instanceof Cache\ApcCache) {
  89
+            throw new \LogicException("Cannot clear APC Cache from Console, its shared in the Webserver memory and not accessible from the CLI.");
  90
+        }
86 91
 
87 92
         $output->write('Clearing ALL Result cache entries' . PHP_EOL);
88 93
 

0 notes on commit 8efae0b

Please sign in to comment.
Something went wrong with that request. Please try again.