A class that implements a simple CLI script to send XML-RPC queries and to display their result.
More...
A class that implements a simple CLI script to send XML-RPC queries and to display their result.
- Authors
- François Poirotte click.nosp@m.y@er.nosp@m.ebot..nosp@m.net
Definition at line 22 of file CLI.php.
static fpoirotte\XRL\CLI::getCopyrightAndLicense |
( |
| ) |
|
|
static |
Return XRL's copyright and license information.
- Return values
-
string | Full copyright and license information. |
Definition at line 60 of file CLI.php.
static fpoirotte\XRL\CLI::getVersion |
( |
| ) |
|
|
static |
Return XRL's version.
- Return values
-
string | XRL's version, or "dev" if the version information could not be retrieved. |
Definition at line 31 of file CLI.php.
fpoirotte\XRL\CLI::parse |
( |
array |
$args | ) |
|
|
protected |
Parse the arguments passed to this script.
- Parameters
-
array | $args | A list with the arguments passed to this script. |
- Return values
-
array | An array of ($options,$params) for this script. |
- Exceptions
-
Exception | Some error occurred during the parsing. See the exception's message for more information. |
Definition at line 331 of file CLI.php.
References fpoirotte\XRL\CLI\parseParam().
Referenced by fpoirotte\XRL\CLI\run().
fpoirotte\XRL\CLI::parseBool |
( |
|
$value | ) |
|
|
protected |
Parse a boolean out of some text. "0", "off" or "false" can be used to represent false
while "1", "on" or "true" can used to represent true
.
- Parameters
-
string | $value | Some text that's supposed to represent a boolean value. |
- Return values
-
bool | The value that was parsed. |
- Exceptions
-
Exception | The given text did not contain a boolean value. |
Definition at line 112 of file CLI.php.
fpoirotte\XRL\CLI::parseFile |
( |
|
$value | ) |
|
|
protected |
Return the content of a file.
- Parameters
-
string | $value | Name of the file to read. |
- Return values
-
string | The content of that file. |
- Exceptions
-
Exception | The file did not exist or its content could not be read. |
Definition at line 137 of file CLI.php.
fpoirotte\XRL\CLI::parseParam |
( |
array & |
$args, |
|
|
\DateTimeZone |
$timezone |
|
) |
| |
|
protected |
Parse this script's arguments and extract parameters.
- Parameters
-
array | $args | Arguments that contain parameters for an XML-RPC request, using the notation this script expects. |
DateTimeZone | $timezone | Timezone information (used to parse date/times). |
- Return values
-
array | The parameters for an XML-RPC request that were parsed by this method. |
- Exceptions
-
Exception | Some error occurred during the parsing. See the exception's message for more information. |
- Note
- The list of arguments passed to this method is modified as it is parsed.
Definition at line 199 of file CLI.php.
Referenced by fpoirotte\XRL\CLI\parse().
fpoirotte\XRL\CLI::parseTimestamp |
( |
|
$value | ) |
|
|
protected |
Parse a date/time value and return a DateTime
object for it.
- Parameters
-
string | $value | A date/time value, using any of the compound formats supported by PHP. |
- Return values
-
DateTime | An object representing that date/time. |
- Exceptions
-
Exception | The given value did not refer to a valid date/time. |
- Note
- See http://php.net/datetime.formats.compound.php for a list of compound formats PHP supports.
Definition at line 165 of file CLI.php.
fpoirotte\XRL\CLI::printUsage |
( |
|
$output, |
|
|
|
$prog |
|
) |
| |
fpoirotte\XRL\CLI::run |
( |
array |
$args | ) |
|
Run this CLI script.
- Parameters
-
array | $args | A list of arguments passed to this script. |
- Return values
-
int | Exit code. 0 is used to indicate a success, while any other code indicates an error. |
- Note
- In case of an error, additional messages may be sent to STDERR by this script.
Definition at line 417 of file CLI.php.
References fpoirotte\XRL\CLI\parse(), and fpoirotte\XRL\CLI\printUsage().
The documentation for this class was generated from the following file: