WorkerFilesBackendMigrate
extends WorkerBase
in package
Base class for worker jobs, which are run via CLI in a separate process
Table of Contents
Properties
- $job_name : mixed
- Specify a custom job name by overwriting this
- $metric_names : mixed
- Specify up to three metrics
- $_new_backend : FilesBackend
- $_new_backend_type : string
- $_old_backend : FilesBackend
- $_old_backend_type : string
- $_options : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructor
- getMetricNames() : array<int, string>
- Gets the metric names.
- getName() : string
- Gets the job name
- run() : mixed
- Do stuff
- copyFile() : mixed
- getTransformName() : int|string|null
- Extract a transform name from a filename string, if one exists
- prepareFileCopy() : mixed
- updateDatabaseRecords() : void
- Big sweeping change to move all migrated data into active cols
Properties
$job_name
Specify a custom job name by overwriting this
protected
mixed
$job_name
= 'Files Backend Migration'
$metric_names
Specify up to three metrics
protected
mixed
$metric_names
= array(1 => '', 2 => '', 3 => '')
$_new_backend
private
FilesBackend
$_new_backend
$_new_backend_type
private
string
$_new_backend_type
$_old_backend
private
FilesBackend
$_old_backend
$_old_backend_type
private
string
$_old_backend_type
$_options
private
array<string|int, mixed>
$_options
= []
Methods
__construct()
Constructor
public
final __construct() : mixed
Manually checks if the method 'run' exists, because it's a varags, so can't use the normal abstract function approach
getMetricNames()
Gets the metric names.
public
getMetricNames() : array<int, string>
Tags
Return values
array<int, string>getName()
Gets the job name
public
getName() : string
Tags
Return values
stringrun()
Do stuff
public
run(array<string|int, mixed> $options) : mixed
Parameters
- $options : array<string|int, mixed>
copyFile()
private
copyFile(FileModel|FileTransformModel $file_model) : mixed
Parameters
- $file_model : FileModel|FileTransformModel
-
Migrate a single file
getTransformName()
Extract a transform name from a filename string, if one exists
private
getTransformName(string $filename) : int|string|null
Parameters
- $filename : string
Return values
int|string|nullprepareFileCopy()
private
prepareFileCopy() : mixed
updateDatabaseRecords()
Big sweeping change to move all migrated data into active cols
private
updateDatabaseRecords() : void