class ScriptHandler

The ScriptHandler class installs users who can log in to the G6K administration interface and a demonstration simulator (if desired).

It is executed by Composer at the end of the G6K installation. See file composer.json (post-install-cmd)

Constants

CHARSET

LABEL

Properties

static private mixed|null $locales

Methods

static void
buildDotenv(Event $event)

Builds environment variables

static void
setEnvironmentVariable(array $variables, mixed $variable, mixed $value)

function setEnvironmentVariable

static mixed
getEnvironmentVariables(Event $event, array $variables)

function getEnvironmentVariables

static void
installUsers(Event $event)

Users installation:

static void
installDemo(Event $event)

Installation of the demonstration simulator from the files "demo.schema.json" and "demo.json" located in the directory 'src/EUREKA/G6KBundle/Resources/data/databases'.

static array|false
getParameters(Event $event, mixed $symfonyDir)

This function parses the '.env' file and returns an array of database parameters

static mixed
getParameterValue(mixed $symfonyDir, mixed $parameter)

function getParameterValue

static mixed
generateRandomSecret()

function generateRandomSecret

Details

at line 95
static void buildDotenv(Event $event)

Builds environment variables

Parameters

Event $event The script event class

Return Value

void

at line 178
static private void setEnvironmentVariable(array $variables, mixed $variable, mixed $value)

function setEnvironmentVariable

set the value of environmentVariable

Parameters

array $variables &$variables
mixed $variable
mixed $value

Return Value

void

at line 196
static private mixed getEnvironmentVariables(Event $event, array $variables)

function getEnvironmentVariables

get the value of environmentVariables

Parameters

Event $event
array $variables

Return Value

mixed the value of environmentVariables

Exceptions

Exception

at line 340
static void installUsers(Event $event)

Users installation:

  • Creation of the database according to parameters provided in parameters.yml
  • Running the 'fos_user.sql' script in the 'src/EUREKA/G6KBundle/Resources/data/databases' directory. This script contains an 'insert' of two users: admin and guest.

Parameters

Event $event The script event class

Return Value

void

at line 456
static void installDemo(Event $event)

Installation of the demonstration simulator from the files "demo.schema.json" and "demo.json" located in the directory 'src/EUREKA/G6KBundle/Resources/data/databases'.

Parameters

Event $event The script event class

Return Value

void

at line 503
static protected array|false getParameters(Event $event, mixed $symfonyDir)

This function parses the '.env' file and returns an array of database parameters

Parameters

Event $event The script event class
mixed $symfonyDir the absolute path of the symfony directory

Return Value

array|false parameters array or false in case of error

at line 538
static protected mixed getParameterValue(mixed $symfonyDir, mixed $parameter)

function getParameterValue

get the value of parameterValue

Parameters

mixed $symfonyDir
mixed $parameter

Return Value

mixed the value of parameterValue

at line 553
static protected mixed generateRandomSecret()

function generateRandomSecret

Return Value

mixed