Cli
in package
This is the CLI interface for sabre-vobject.
Tags
Table of Contents
- $forgiving : bool
- Makes the parser less strict.
- $format : string
- Whether to spit out 'mimedir' or 'json' format.
- $inputFormat : string
- Input format (one of json or mimedir).
- $inputPath : string
- Source file.
- $outputPath : string
- Destination file.
- $parser : mixed
- $pretty : bool
- JSON pretty print.
- $quiet : bool
- No output.
- $showHelp : bool
- Help display.
- $stderr : resource
- stderr.
- $stdin : resource
- stdin.
- $stdout : resource
- output stream.
- main() : int
- Main function.
- color() : int
- Colorizes a file.
- colorize() : string
- Returns an ansi color string for a color name.
- convert() : int
- Converts a vObject file to a new format.
- cWrite() : mixed
- Writes out a string in specific color.
- log() : mixed
- Sends a message to STDERR.
- parseArguments() : mixed
- Parses the list of arguments.
- readInput() : Component
- Reads the input file.
- repair() : int
- Repairs a VObject file.
- serializeComponent() : mixed
- serializeProperty() : mixed
- Colorizes a property.
- showHelp() : mixed
- Shows the help message.
- validate() : int
- Validates a VObject file.
Properties
$forgiving
Makes the parser less strict.
protected
bool
$forgiving
= false
$format
Whether to spit out 'mimedir' or 'json' format.
protected
string
$format
$inputFormat
Input format (one of json or mimedir).
protected
string
$inputFormat
$inputPath
Source file.
protected
string
$inputPath
$outputPath
Destination file.
protected
string
$outputPath
$parser
protected
mixed
$parser
$pretty
JSON pretty print.
protected
bool
$pretty
$quiet
No output.
protected
bool
$quiet
= false
$showHelp
Help display.
protected
bool
$showHelp
= false
$stderr
stderr.
protected
resource
$stderr
$stdin
stdin.
protected
resource
$stdin
$stdout
output stream.
protected
resource
$stdout
Methods
main()
Main function.
public
main(array<string|int, mixed> $argv) : int
Parameters
- $argv : array<string|int, mixed>
Return values
int —color()
Colorizes a file.
protected
color(Component $vObj) : int
Parameters
- $vObj : Component
Return values
int —colorize()
Returns an ansi color string for a color name.
protected
colorize(string $color, mixed $str[, mixed $resetTo = 'default' ]) : string
Parameters
- $color : string
- $str : mixed
- $resetTo : mixed = 'default'
Return values
string —convert()
Converts a vObject file to a new format.
protected
convert(Component $vObj) : int
Parameters
- $vObj : Component
Return values
int —cWrite()
Writes out a string in specific color.
protected
cWrite(string $color, string $str) : mixed
Parameters
- $color : string
- $str : string
Return values
mixed —log()
Sends a message to STDERR.
protected
log(string $msg[, mixed $color = 'default' ]) : mixed
Parameters
- $msg : string
- $color : mixed = 'default'
Return values
mixed —parseArguments()
Parses the list of arguments.
protected
parseArguments(array<string|int, mixed> $argv) : mixed
Parameters
- $argv : array<string|int, mixed>
Return values
mixed —readInput()
Reads the input file.
protected
readInput() : Component
Return values
Component —repair()
Repairs a VObject file.
protected
repair(Component $vObj) : int
Parameters
- $vObj : Component
Return values
int —serializeComponent()
protected
serializeComponent(Component $vObj) : mixed
Parameters
- $vObj : Component
Return values
mixed —serializeProperty()
Colorizes a property.
protected
serializeProperty(Property $property) : mixed
Parameters
- $property : Property
Return values
mixed —showHelp()
Shows the help message.
protected
showHelp() : mixed
Return values
mixed —validate()
Validates a VObject file.
protected
validate(Component $vObj) : int
Parameters
- $vObj : Component