Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2509

Add CLI detection for the APC check on Console cache commands

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.3.4
    • Fix Version/s: None
    • Component/s: Tools
    • Security Level: All
    • Labels:
      None

      Description

      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: https://github.com/doctrine/doctrine2/commit/8efae0b232210b27200f2709e7fcb24c7f02c5de

      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:

      After:

        Activity

        Hide
        Marco Pivetta added a comment -

        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.

        Show
        Marco Pivetta added a comment - 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.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Jonathan Cardoso Machado
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: