/** * Constructor. * * @param KernelInterface $kernel A KernelInterface instance */ public function __construct(BBApplication $application = null) { $this->application = $application; parent::__construct('BackBee', BBApplication::VERSION . ($application->isDebugMode() ? '/debug' : '')); $this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $this->application->getEnvironment())); $this->getDefinition()->addOption(new InputOption('--app', '-a', InputOption::VALUE_REQUIRED, 'The BackBee application classname.', get_class($this->application))); $this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.')); }
/** * @param BBApplication $bbapp */ public function __construct($bbapp, $dsn) { if (true === $bbapp->isDebugMode()) { parent::__construct($dsn); } }
/** * @see BackBee\Cache\Validator\ValidatorInterface::isValid */ public function isValid($object = null) { return false === $this->application->isDebugMode() && null === $this->application->getBBUserToken() && true === $this->application->isStarted() && false === $this->application->isClientSAPI(); }