DDC-2509: Add CLI detection for the APC check on Console cache commands #3231

Closed
doctrinebot opened this Issue Jun 17, 2013 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user jcm:

There is some instanceof checks on the \Doctrine\ORM\Tools\Console\Command\ClearCache* commands to detect if APC is being used, they were introduced here: 8efae0b

I would like to know if it's possible to add a CLI check too, something like:
if ($cacheDriver instanceof Cache\ApcCache && PHP_SAPI === 'cli' )

Yeah, I know that those are CLI commands, and so the check looks like unecessary, however, in the particular case that I found it's necessary, I'm running the commands under an WebUI:
Before the modification:
!http://i.imgur.com/8a2iVl7.jpg!

After:
!http://i.imgur.com/LTN1aDa.jpg!

@doctrinebot

Comment created by @ocramius:

CLI commands are not meant to be used in WEB environment (at least not the Symfony CLI ones). You should probably replicate that logic instead.

@doctrinebot

Issue was closed with resolution "Won't Fix"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment