Skip to content

Configuring Eseye

Leon Jacobs edited this page Jan 27, 2017 · 7 revisions

SeAT

Configuring Eseye

Configuration for Eseye follows a singleton pattern, meaning that there can only ever exist one instance of the Configuration class in the lifetime of a php process.

configuration flow

Generally, you will want to get the Configuration class and set any settings you want before instantiating a new Eseye instance.

getting the singleton

Getting access to the configuration singleton is as easy as:

$configuration = \Seat\Eseye\Configuration::getInstance();

Thats it. You can now set settings by simply setting properties (invoking the __set() method under the hood). For a reference on what the defaults are for Eseye, see this source file: https://github.com/eveseat/eseye/blob/master/src/Containers/EsiConfiguration.php

example setting logfile

Lets look at a quick example to set the logfile for Eseye:

// Set configuration
$configuration = \Seat\Eseye\Configuration::getInstance();
$configuration->logfile_location = '/var/log/eseye';

// Get an Eseye instance
$esi = new \Seat\Eseye\Eseye;

example setting datasource

Lets look at a quick example to set the datasource for Eseye, as can be seen on the ESI Interface. The default for Eseye is tranquility and can be seen here.

// Set configuration
$configuration = \Seat\Eseye\Configuration::getInstance();
$configuration->datasource = 'singularity';

// Get an Eseye instance
$esi = new \Seat\Eseye\Eseye;