/**
  * @return bool
  */
 public function getEnabled()
 {
     $enabled = $this->config->get(self::ENABLED);
     $disabled = $this->config->get(self::DISABLED);
     if ($enabled !== null) {
         return $enabled;
     }
     if ($disabled !== null) {
         return !$disabled;
     }
     return false;
 }
Example #2
0
File: App.php Project: weew/app
 /**
  * Start App.
  */
 public function start()
 {
     if ($this->started) {
         return;
     }
     $this->started = true;
     $this->getConfigLoader()->setEnvironment($this->getEnvironment());
     $this->config = $this->getConfigLoader()->load();
     $this->container->set([Config::class, IConfig::class], $this->config);
     $this->config->set('env', $this->getEnvironment());
     $this->config->set('debug', $this->getDebug());
     $this->eventer->dispatch(new ConfigLoadedEvent($this->config));
     $this->kernel->initialize();
     $this->eventer->dispatch(new KernelInitializedEvent($this->kernel));
     $this->kernel->boot();
     $this->eventer->dispatch(new KernelBootedEvent($this->kernel));
     $this->eventer->dispatch(new AppStartedEvent($this));
 }
 /**
  * Load routes from config.
  */
 protected function loadRoutesFromConfig()
 {
     $config = $this->config->getRaw('routing', []);
     $this->routerConfigurator->processConfig($this->router, $config);
 }
 /**
  * @return mixed
  */
 public function getErrorChannelName()
 {
     return $this->config->get(self::ERROR_CHANNEL_NAME);
 }
Example #5
0
 /**
  * @param $configName
  *
  * @return string
  */
 public function getLogLevelForChannelConfig($configName)
 {
     return $this->config->get(self::LOG_CHANNEL_LOG_LEVEL($configName));
 }
Example #6
0
 /**
  * @param IConfig $config
  *
  * @return IConfig
  */
 public function extend(IConfig $config)
 {
     $this->merge($config->getConfig());
     return $this;
 }
Example #7
0
 /**
  * @return string
  */
 public function getMigrationsTable()
 {
     return $this->config->get(self::MIGRATIONS_TABLE);
 }
Example #8
0
 /**
  * @return array
  */
 public function getNamespaces()
 {
     return $this->config->get(self::NAMESPACES, []);
 }
 /**
  * @param string $name
  *
  * @return string|null
  */
 public function getTransportType($name)
 {
     return $this->config->get(self::TRANSPORT_TYPE($name));
 }
 /**
  * @return int
  */
 public function getNumberOfSkippedStackTraceLines()
 {
     return $this->config->get(self::NUMBER_OF_SKIPPED_STACK_TRACE_LINES, 0);
 }