-
Notifications
You must be signed in to change notification settings - Fork 31
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.
Generally, you will want to get the Configuration
class and set any settings you want before instantiating a new Eseye
instance.
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
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;
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;