BaseComponent
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
No description
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.
Automatically loads configuration from datadir, instantiates specified config class and validates it with specified confing definition class
No description
No description
No description
No description
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.
Data dir is set without the trailing slash
No description
No description
No description
No description
No description
No description
This is the main method for your code to run in. You have the Config
and ManifestManager
ready as well as environment set up.
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.
Loads manifest manager with application's datadir
No description
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)
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.
at line 86
protected void
loadConfig()
Automatically loads configuration from datadir, instantiates specified config class and validates it with specified confing definition class
at line 100
protected void
initializeSyncActions()
at line 121
protected void
loadInputState()
at line 139
protected void
writeOutputStateToFile(array $state)
at line 147
protected array
getRawConfig()
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.
at line 162
protected void
setConfig(BaseConfig $config)
at line 172
protected void
setDataDir(string $dataDir)
Data dir is set without the trailing slash
at line 177
string
getDataDir()
at line 182
BaseConfig
getConfig()
at line 187
ManifestManager
getManifestManager()
at line 192
LoggerInterface
getLogger()
at line 197
array
getInputState()
at line 202
void
execute()
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.
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.
at line 241
protected void
loadManifestManager()
Loads manifest manager with application's datadir
at line 246
bool
isSyncAction()
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')