Add the name for the logs db to .env. Add parameter for logs db to services.yaml. #330
This commit is contained in:
parent
882a36f705
commit
29add2f078
3 changed files with 14 additions and 8 deletions
|
|
@ -18,6 +18,11 @@ LOGGING_DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_logging
|
||||||
###< doctrine/doctrine-bundle ###
|
###< doctrine/doctrine-bundle ###
|
||||||
GMAPS_API_KEY=insert_gmapsapikey_here
|
GMAPS_API_KEY=insert_gmapsapikey_here
|
||||||
|
|
||||||
|
# influxdb
|
||||||
|
INFLUXDB_HOST=127.0.0.1
|
||||||
|
INFLUXDB_PORT=8086
|
||||||
|
INFLUXDB_DB=logging_db
|
||||||
|
|
||||||
# rising tide sms gateway
|
# rising tide sms gateway
|
||||||
RT_USER=rt_user
|
RT_USER=rt_user
|
||||||
RT_PASS=rt_pass
|
RT_PASS=rt_pass
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ parameters:
|
||||||
app_access_key: 'access_keys'
|
app_access_key: 'access_keys'
|
||||||
cvu_brand_id: "%env(CVU_BRAND_ID)%"
|
cvu_brand_id: "%env(CVU_BRAND_ID)%"
|
||||||
country_code: "%env(COUNTRY_CODE)%"
|
country_code: "%env(COUNTRY_CODE)%"
|
||||||
|
log_db: "%env(INFLUXDB_DB)%"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# default configuration for services in *this* file
|
# default configuration for services in *this* file
|
||||||
|
|
@ -22,12 +23,6 @@ services:
|
||||||
# fetching services directly from the container via $container->get() won't work.
|
# fetching services directly from the container via $container->get() won't work.
|
||||||
# The best practice is to be explicit about your dependencies anyway.
|
# The best practice is to be explicit about your dependencies anyway.
|
||||||
|
|
||||||
# influxdb
|
|
||||||
InfluxDB\Client:
|
|
||||||
arguments: ['%env(INFLUXDB_HOST)%', '%env(INFLUXDB_PORT)%']
|
|
||||||
InfluxDB\Database:
|
|
||||||
arguments: ['%env(INFLUXDB_DB)%', "@InfluxDB\\Client"]
|
|
||||||
|
|
||||||
# makes classes in src/ available to be used as services
|
# makes classes in src/ available to be used as services
|
||||||
# this creates a service per class whose id is the fully-qualified class name
|
# this creates a service per class whose id is the fully-qualified class name
|
||||||
App\:
|
App\:
|
||||||
|
|
@ -228,6 +223,12 @@ services:
|
||||||
App\Service\GISManagerInterface: "@App\\Service\\GISManager\\OpenStreet"
|
App\Service\GISManagerInterface: "@App\\Service\\GISManager\\OpenStreet"
|
||||||
#App\Service\GISManagerInterface: "@App\\Service\\GISManager\\Google"
|
#App\Service\GISManagerInterface: "@App\\Service\\GISManager\\Google"
|
||||||
|
|
||||||
|
# influxdb
|
||||||
|
InfluxDB\Client:
|
||||||
|
arguments: ['%env(INFLUXDB_HOST)%', '%env(INFLUXDB_PORT)%']
|
||||||
|
InfluxDB\Database:
|
||||||
|
arguments: ['%env(INFLUXDB_DB)%', "@InfluxDB\\Client"]
|
||||||
|
|
||||||
App\EventListener\JobOrderActiveCacheListener:
|
App\EventListener\JobOrderActiveCacheListener:
|
||||||
arguments:
|
arguments:
|
||||||
$jo_cache: "@App\\Service\\JobOrderCache"
|
$jo_cache: "@App\\Service\\JobOrderCache"
|
||||||
|
|
|
||||||
|
|
@ -503,8 +503,8 @@ class UserController extends Controller
|
||||||
public function getLogs(Client $client, $id)
|
public function getLogs(Client $client, $id)
|
||||||
{
|
{
|
||||||
// fetch database
|
// fetch database
|
||||||
// TODO: find way to replace hardcoded db name
|
$log_db = $this->getParameter('log_db');
|
||||||
$database = $client->selectDB('logging_db');
|
$database = $client->selectDB($log_db);
|
||||||
|
|
||||||
// query will return a resultset object
|
// query will return a resultset object
|
||||||
$query_string = 'SELECT * FROM entity_log WHERE "user" = ' . $id;
|
$query_string = 'SELECT * FROM entity_log WHERE "user" = ' . $id;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue