You are here

public function DatabaseSource::configSchema in Backup and Migrate 8.4

Get a definition for user-configurable settings.

Parameters

array $params:

Return value

array

Overrides ConfigurableTrait::configSchema

File

lib/backup_migrate_core/src/Source/DatabaseSource.php, line 25

Class

DatabaseSource
Class DatabaseSource.

Namespace

BackupMigrate\Core\Source

Code

public function configSchema($params = []) {
  $schema = [];

  // Init settings.
  if ($params['operation'] == 'initialize') {
    $schema['fields']['host'] = [
      'type' => 'text',
      'title' => 'Hostname',
    ];
    $schema['fields']['database'] = [
      'type' => 'text',
      'title' => 'Database',
    ];
    $schema['fields']['username'] = [
      'type' => 'text',
      'title' => 'Username',
    ];
    $schema['fields']['password'] = [
      'type' => 'password',
      'title' => 'Password',
    ];
    $schema['fields']['port'] = [
      'type' => 'number',
      'min' => 1,
      'max' => 65535,
      'title' => 'Port',
    ];
  }
  return $schema;
}