'127.0.0.1', # localhost )); $hostname = $hardcoded_configuration->get('hostname'); $port = null; $auth_password = null; $auth_username = null; if (\core\config\GlobalConfiguration::exists('class', 'core', 'log', 'client', 'settings')) { $configuration = \core\config\GlobalConfiguration::read('class', 'core', 'log', 'client', 'settings'); if ($configuration->exists('hostname')) { $hostname = $configuration->get('host'); } if ($configuration->exists('port')) { $port = $configuration->get('port'); } if ($configuration->exists('auth', 'password')) { $auth_password = $configuration->get('auth', 'password'); } if ($configuration->exists('auth', 'username')) { $auth_username = $configuration->get('auth', 'username'); } } $this->tag = $tag; $config = array( 'host' => $hostname, ); if (!\is_null($port)) { $config['port'] = $port; } if (!\is_null($auth_username)) { $config['auth'] = array($auth_username); } if (!\is_null($auth_password)) { if (\in_array('auth', \array_keys($config))) { $config['auth'][] = $auth_password; } else { $config['auth'] = array($auth_password); } } $this->client = new \Redis($config); } public function push(\core\log\Event $event) : \core\log\Event { $this->client->rpush($tag->generate_id(), $event->display()); return $event; } } ?>