/** * Constructor * * @author Art <*****@*****.**> * * @param LoggerInterface $logger If provided, this will be used to log errors and exceptions. * @param AbstractConfig $cfg The configuration class. Required. * * @since 1.4 $cfg added. This will become the first parameter in the constructor in 2.0 */ public function __construct(LoggerInterface $logger = null, AbstractConfig $cfg = null) { if (!$logger) { $logger = new Log(); } $this->config = Alo::ifnull($cfg, new AbstractConfig()); $this->logger = $logger; $this->isCLI = !$this->config->forceHTML && Alo::isCliRequest(); $this->initSymfony(); }
/** * Checks if the session should be saved/written * * @author Art <*****@*****.**> * @return bool * @since 1.1 */ protected function shouldBeSaved() { $isCli = Alo::isCliRequest(); return !$isCli || $isCli && $this->config->saveCLI; }