class BaseComponent

This is the core class that does all the heavy lifting. By default you don't need to setup anything. There are some extension points for you to use if you want to customise the behavior.

Methods

__construct(LoggerInterface $logger)

No description

static void
setEnvironment()

Prepares environment. Sets error reporting for the app to fail on any error, warning or notice. If your code emits notices and cannot be fixed, you can set error_reporting in $application->run() method.

void
loadConfig()

Automatically loads configuration from datadir, instantiates specified config class and validates it with specified confing definition class

void
initializeSyncActions()

No description

void
loadInputState()

No description

void
writeOutputStateToFile(array $state)

No description

array
getRawConfig()

No description

string
getConfigDefinitionClass()

Override this method if you have custom config definition class. This allows you to validate and require config parameters and fail fast if there is a missing parameter.

void
setConfig(BaseConfig $config)

No description

void
setDataDir(string $dataDir)

Data dir is set without the trailing slash

string
getDataDir()

No description

getConfig()

No description

LoggerInterface
getLogger()

No description

array
getInputState()

No description

void
execute()

No description

void
run()

This is the main method for your code to run in. You have the Config and ManifestManager ready as well as environment set up.

string
getConfigClass()

Class of created config. It's useful if you want to implment getters for parameters in your config. It's prefferable to accessing configuration keys as arrays.

void
loadManifestManager()

Loads manifest manager with application's datadir

bool
isSyncAction()

No description

array
getSyncActions()

Whitelist method names that can be used as synchronous actions. This is a safeguard against executing any method of the component.

Details

at line 44
__construct(LoggerInterface $logger)

Parameters

LoggerInterface $logger

at line 68
static void setEnvironment()

Prepares environment. Sets error reporting for the app to fail on any error, warning or notice. If your code emits notices and cannot be fixed, you can set error_reporting in $application->run() method.

Return Value

void

at line 86
protected void loadConfig()

Automatically loads configuration from datadir, instantiates specified config class and validates it with specified confing definition class

Return Value

void

at line 100
protected void initializeSyncActions()

Return Value

void

at line 121
protected void loadInputState()

Return Value

void

at line 139
protected void writeOutputStateToFile(array $state)

Parameters

array $state

Return Value

void

at line 147
protected array getRawConfig()

Return Value

array

at line 157
protected string getConfigDefinitionClass()

Override this method if you have custom config definition class. This allows you to validate and require config parameters and fail fast if there is a missing parameter.

Return Value

string

at line 162
protected void setConfig(BaseConfig $config)

Parameters

BaseConfig $config

Return Value

void

at line 172
protected void setDataDir(string $dataDir)

Data dir is set without the trailing slash

Parameters

string $dataDir

Return Value

void

at line 177
string getDataDir()

Return Value

string

at line 182
BaseConfig getConfig()

Return Value

BaseConfig

at line 187
ManifestManager getManifestManager()

Return Value

ManifestManager

at line 192
LoggerInterface getLogger()

Return Value

LoggerInterface

at line 197
array getInputState()

Return Value

array

at line 202
void execute()

Return Value

void

at line 223
protected void run()

This is the main method for your code to run in. You have the Config and ManifestManager ready as well as environment set up.

Return Value

void

at line 233
protected string getConfigClass()

Class of created config. It's useful if you want to implment getters for parameters in your config. It's prefferable to accessing configuration keys as arrays.

Return Value

string

at line 241
protected void loadManifestManager()

Loads manifest manager with application's datadir

Return Value

void

at line 246
bool isSyncAction()

Return Value

bool

at line 257
protected array getSyncActions()

Whitelist method names that can be used as synchronous actions. This is a safeguard against executing any method of the component.

Format: 'action' => 'method name' (e.g. 'getTables' => 'handleTableSyncAction')

Return Value

array