/** * Log constructor. * * @param string|null $file */ protected function __construct($file = null) { $this->file = $file ?: Config::getInstance()->get("log.file"); if (!file_exists($this->file)) { touch($this->file); } $this->spl = new SplFileObject($this->file, "a"); }
/** * Return common option * * @return InputOption[] */ public function getCommonInputOption() { static $options; if (is_null($options)) { $options = []; $options[] = new InputOption("--config-file", null, InputOption::VALUE_REQUIRED, "Set config file", $this->config->getFile()); } return $options; }
/** * Get config * * @param string|null $key * @param mixed $default * @return Config|mixed */ function config($key = null, $default = null) { $config = Config::getInstance(); return $config->get($key, $default); }
/** * Get config * * @param string $key * @param mixed $default * @return mixed */ protected function config($key, $default = null) { return $this->config->get($key, $default); }