Helper method for CLI script to upload users (also has special wrappers for cli* functions for phpunit testing)
More...
|
| | __construct (?string $progresstrackerclass=null) |
| | cli_helper constructor.
|
| |
| | get_cli_option (string $key) |
| | Get CLI option.
|
| |
| | get_stats () |
| | Get process statistics.
|
| |
|
| print_help () |
| | Print help for export.
|
| |
|
| process () |
| | Process the upload.
|
| |
|
| | cli_error ($text, $errorcode=1) |
| | Write to standard error output and exit with the given code.
|
| |
| | cli_problem ($text) |
| | Write error notification.
|
| |
| | cli_write ($text) |
| | Write a text to the given stream.
|
| |
| | cli_writeln ($text) |
| | Write a text followed by an end of line symbol to the given stream.
|
| |
| | convert_to_table (array $column1, array $column2, int $indent=0) |
| | Display as CLI table.
|
| |
| | die ($errorcode) |
| | Wrapper for "die()" method so we can unittest it.
|
| |
| | mock_form (array $customdata, array $submitteddata) |
| | Mock form submission.
|
| |
| | options_definitions () |
| | Options used in this CLI script.
|
| |
| | prepare_form_elements_for_cli (array $elements, array $defaults) |
| | Prepare form elements for CLI.
|
| |
| | print_help_options (array $options) |
| | Display available CLI options as a table.
|
| |
|
|
array | $clioptions |
| |
|
string | $operation |
| |
|
process | $process |
| |
|
string | $progresstrackerclass |
| |
|
array | $unrecognized |
| |
Helper method for CLI script to upload users (also has special wrappers for cli* functions for phpunit testing)
- Copyright
- 2020 Marina Glancy
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
| tool_uploaduser\cli_helper::__construct |
( |
?string | $progresstrackerclass = null | ) |
|
cli_helper constructor.
- Parameters
-
| string | null | $progresstrackerclass | |
◆ cli_error()
| tool_uploaduser\cli_helper::cli_error |
( |
| $text, |
|
|
| $errorcode = 1 ) |
|
protected |
Write to standard error output and exit with the given code.
- Parameters
-
| string | $text | |
| int | $errorcode | |
- Return values
-
◆ cli_problem()
| tool_uploaduser\cli_helper::cli_problem |
( |
| $text | ) |
|
|
protected |
Write error notification.
- Parameters
-
- Return values
-
◆ cli_write()
| tool_uploaduser\cli_helper::cli_write |
( |
| $text | ) |
|
|
protected |
Write a text to the given stream.
- Parameters
-
| string | $text | text to be written |
◆ cli_writeln()
| tool_uploaduser\cli_helper::cli_writeln |
( |
| $text | ) |
|
|
protected |
Write a text followed by an end of line symbol to the given stream.
- Parameters
-
| string | $text | text to be written |
◆ convert_to_table()
| tool_uploaduser\cli_helper::convert_to_table |
( |
array | $column1, |
|
|
array | $column2, |
|
|
int | $indent = 0 ) |
|
protected |
Display as CLI table.
- Parameters
-
| array | $column1 | |
| array | $column2 | |
| int | $indent | |
- Return values
-
◆ die()
| tool_uploaduser\cli_helper::die |
( |
| $errorcode | ) |
|
|
protected |
Wrapper for "die()" method so we can unittest it.
- Parameters
-
- Exceptions
-
◆ get_cli_option()
| tool_uploaduser\cli_helper::get_cli_option |
( |
string | $key | ) |
|
Get CLI option.
- Parameters
-
- Return values
-
◆ get_stats()
| tool_uploaduser\cli_helper::get_stats |
( |
| ) |
|
Get process statistics.
- Return values
-
◆ mock_form()
| tool_uploaduser\cli_helper::mock_form |
( |
array | $customdata, |
|
|
array | $submitteddata ) |
|
protected |
Mock form submission.
- Parameters
-
| array | $customdata | |
| array | $submitteddata | |
- Return values
-
◆ options_definitions()
| tool_uploaduser\cli_helper::options_definitions |
( |
| ) |
|
|
protected |
Options used in this CLI script.
- Return values
-
◆ prepare_form_elements_for_cli()
| tool_uploaduser\cli_helper::prepare_form_elements_for_cli |
( |
array | $elements, |
|
|
array | $defaults ) |
|
protected |
Prepare form elements for CLI.
- Parameters
-
| HTML_QuickForm_element[] | $elements | |
| array | $defaults | |
- Return values
-
◆ print_help_options()
| tool_uploaduser\cli_helper::print_help_options |
( |
array | $options | ) |
|
|
protected |
Display available CLI options as a table.
- Parameters
-
The documentation for this class was generated from the following file:
- admin/tool/uploaduser/classes/cli_helper.php