CopyDataSourceCommand
class CopyDataSourceCommand extends CommandBase
Copies one or all data sources from another instance of G6K.
Only internal databases will be copied with this command.
Traits
Properties
protected string | $name | from CommandBase | |
protected string | $version | from CommandBase | |
protected array|false | $parameters | from CommandBase | |
protected string | $projectDir | from CommandBase | |
protected string | $publicDir | from CommandBase | |
protected Translator | $translator | from CommandBase | |
protected bool | $initialized | from CommandBase | |
protected bool | $html | from CommandBase | |
protected array | $datatypes | from DatasourcesTrait | |
private int | $maxDataSourceId | ||
private int | $maxDatabaseId |
Methods
No description
This function parses the '.env' file and returns an array of parameters
initializes the current command.
Asks an argument if it's not supplied in the command line.
No description
Run an embedded console command.
Retuns the DOMElement at position $index of the DOMNodeList
Converts a relative path of a file to an absolute path
Finds files in the subdirectories of a giving directory
Finds the assets directory
Finds the templates directory
Finds the pdf forms directory
Finds the simulators directory
Displays an message
Displays an info message
Displays a warning message
Displays a success message
Displays a failure message
Displays an fatal error message
Displays an error message
Displays a debug message
Displays a comment
No description
No description
No description
No description
No description
Constructs a Database object
Returns informations about the columns of a table
Constructs a form fields with informations about the columns of a table
Retrieves the choice values of a data in the result list of a query on a data source
Executes the query from a source
Filters the result set of a query on the source return path
Filters the result set of a query on the source return path
Inserts a row into a table
Updates a table row
Deletes a row from a table
Checks the value of a column
Does the migration of data from a database to another.
Creates a database
Creates a database table
Drops a table
Edits a table structure
Emulates a 'ALTER TABLE' for columns of a SQLite database.
Checks the argument of the current command (g6k:datasource:copy).
Details
at line 61
__construct(string $projectDir)
in CommandBase at line 111
private void
doInitialization()
Realizes the initialization this command
in CommandBase at line 136
private array|false
getParameters()
This function parses the '.env' file and returns an array of parameters
in CommandBase at line 169
private string
getParameterValue(string $parameter)
Returns the value of a parameter
in CommandBase at line 184
protected string
getConfigParameter(string $parameter)
Gets a parameter with its name.
in CommandBase at line 194
protected void
configure()
Configures the current command.
in CommandBase at line 228
protected void
initialize(InputInterface $input, OutputInterface $output)
initializes the current command.
in CommandBase at line 259
protected void
askArgument(InputInterface $input, OutputInterface $output, string $argumentName, string $questionText)
Asks an argument if it's not supplied in the command line.
at line 146
protected int|null
execute(InputInterface $input, OutputInterface $output)
in CommandBase at line 307
protected bool
runEmbeddedCommand(array $command, InputInterface $input, OutputInterface $output)
Run an embedded console command.
in CommandBase at line 325
protected DOMElement|null
castDOMElement(DOMNode $node)
Casts a DOMNode to DOMElement
in CommandBase at line 341
protected DOMElement|null
getDOMElementItem(DOMNodeList $nodes, int $index)
Retuns the DOMElement at position $index of the DOMNodeList
in CommandBase at line 357
protected string
resolvePath(string $path, string $base)
Converts a relative path of a file to an absolute path
in CommandBase at line 385
protected array
findFile(string $in, string $name, InputInterface $input, OutputInterface $output, array $filters = [])
Finds files in the subdirectories of a giving directory
in CommandBase at line 438
protected string|int
findAssetsDirectory(string $in, InputInterface $input, OutputInterface $output)
Finds the assets directory
in CommandBase at line 482
protected string|int
findTemplatesDirectory(string $in, InputInterface $input, OutputInterface $output)
Finds the templates directory
in CommandBase at line 526
protected string|int
findPDFFormsDirectory(string $in, InputInterface $input, OutputInterface $output)
Finds the pdf forms directory
in CommandBase at line 570
protected string|int
findSimulatorsDirectory(string $in, InputInterface $input, OutputInterface $output)
Finds the simulators directory
in CommandBase at line 611
protected bool
isHtml()
Returns true, if the message are displayed in HTML, false if not.
in CommandBase at line 627
private void
message(OutputInterface $output, string $message, array $parameters = [], string $start = 'info', string $end = 'info', int $verbosity = OutputInterface::VERBOSITY_NORMAL)
Displays an message
in CommandBase at line 647
protected void
info(OutputInterface $output, string $message, array $parameters = [])
Displays an info message
in CommandBase at line 664
protected void
warning(OutputInterface $output, string $message, array $parameters = [])
Displays a warning message
in CommandBase at line 681
protected void
success(OutputInterface $output, string $message, array $parameters = [])
Displays a success message
in CommandBase at line 698
protected void
failure(OutputInterface $output, string $message, array $parameters = [])
Displays a failure message
in CommandBase at line 715
protected void
fatal(OutputInterface $output, string $message, array $parameters = [])
Displays an fatal error message
in CommandBase at line 732
protected void
error(OutputInterface $output, string $message, array $parameters = [])
Displays an error message
in CommandBase at line 749
protected void
debug(OutputInterface $output, string $message, array $parameters = [])
Displays a debug message
in CommandBase at line 762
protected void
comment(OutputInterface $output, string $message, array $parameters = [])
Displays a comment
at line 68
protected string
getCommandName()
at line 75
protected string
getCommandDescription()
at line 82
protected string
getCommandHelp()
at line 100
protected array
getCommandArguments()
at line 118
protected array
getCommandOptions()
in DatasourcesTrait at line 192
protected Database
getDatabase(int $dsid, SimpleXMLElement $datasources, string|null $databasesDir = null, bool $withDbName = true)
Constructs a Database object
in DatasourcesTrait at line 211
protected array|string|bool|null
tablesList(Database $database)
Returns the list of tables of a database
in DatasourcesTrait at line 249
protected array|string|bool|null
tableInfos(Database $database, string $table)
Returns informations about a table of a database
in DatasourcesTrait at line 302
protected array
infosColumns(SimpleXMLElement $datasources, Database $database, string $table)
Returns informations about the columns of a table
in DatasourcesTrait at line 361
protected array
infosColumnsToForm(string $table, array $infosColumns)
Constructs a form fields with informations about the columns of a table
in DatasourcesTrait at line 398
protected array
getChoicesFromSource(SimpleXMLElement $source, array|null $result)
Retrieves the choice values of a data in the result list of a query on a data source
in DatasourcesTrait at line 461
protected array|string|null
executeSource(SimpleXMLElement $source, SimpleXMLElement $datasources, string|null $databasesDir = null)
Executes the query from a source
in DatasourcesTrait at line 523
protected array|null
filterResult(array|string $result, SimpleXMLElement $source)
Filters the result set of a query on the source return path
in DatasourcesTrait at line 548
protected array
filterResultByLines(array $result, string $filter)
Filters the result set of a query on the source return path
in DatasourcesTrait at line 589
protected string|bool
insertRowIntoTable(array $row, string $table, array $infosColumns, Database $database, TranslatorInterface $translator = null, bool $restore = false, bool $fromOtherTable = false)
Inserts a row into a table
in DatasourcesTrait at line 638
protected bool|string
updateRowInTable(array $row, string $table, SimpleXMLElement $datasources, Database $database, TranslatorInterface $translator = null, bool $fromOtherTable = false)
Updates a table row
in DatasourcesTrait at line 685
protected string|true
deleteRowFromTable(array $row, string $table, Database $database, TranslatorInterface $translator = null)
Deletes a row from a table
in DatasourcesTrait at line 709
protected string|bool
checkColumnValue(array $info, string|null $value, TranslatorInterface $translator = null, bool $fromOtherTable = false)
Checks the value of a column
in DatasourcesTrait at line 847
protected string|true
migrateDatabase(int $dsid, string $dbtype, SimpleXMLElement $datasources, SimpleXMLElement $fromDatasources, Database $fromDatabase, string|null $databasesDir = null, TranslatorInterface $translator = null, callable|null $fprogress = null)
Does the migration of data from a database to another.
in DatasourcesTrait at line 895
protected string|true
createDatabase(int $dsid, string $dbtype, SimpleXMLElement $datasources, string|null $databasesDir = null, TranslatorInterface $translator = null)
Creates a database
in DatasourcesTrait at line 953
protected string|true
createDatabaseTable(array $form, Database $database, TranslatorInterface $translator = null)
Creates a database table
in DatasourcesTrait at line 1032
protected string|true
dropDatabaseTable(string $table, Database $database, TranslatorInterface $translator = null)
Drops a table
in DatasourcesTrait at line 1057
protected string|true
editTableStructure(array $form, string $table, Database $database, SimpleXMLElement $datasources, TranslatorInterface $translator = null)
Edits a table structure
in DatasourcesTrait at line 1277
protected bool
alterSQLiteTable(string $table, string $alterdefs, Database $database, TranslatorInterface $translator = null)
Emulates a 'ALTER TABLE' for columns of a SQLite database.
ALTER TABLE tbl_name alter_specification [, alter_specification] ...
alter_specification: ADD column_definition | DROP column_definition | CHANGE old_col_name column_definition
column_definition: same as for create table statements
at line 137
protected void
interact(InputInterface $input, OutputInterface $output)
Checks the argument of the current command (g6k:datasource:copy).