Skip to content
Evert Pot edited this page Sep 1, 2014 · 3 revisions

Sabre\VObject\Cli

This is the CLI interface for sabre-vobject.

  • Class name: Cli
  • Namespace: Sabre\VObject

Properties

$quiet

protected boolean $quiet = false

No output

  • Visibility: protected

$showHelp

protected boolean $showHelp = false

Help display

  • Visibility: protected

$format

protected string $format

Wether to spit out 'mimedir' or 'json' format.

  • Visibility: protected

$pretty

protected boolean $pretty

JSON pretty print

  • Visibility: protected

$inputPath

protected string $inputPath

Source file

  • Visibility: protected

$outputPath

protected string $outputPath

Destination file

  • Visibility: protected

$stdout

protected resource $stdout

output stream

  • Visibility: protected

$stdin

protected resource $stdin

stdin

  • Visibility: protected

$stderr

protected resource $stderr

stderr

  • Visibility: protected

$inputFormat

protected string $inputFormat

Input format (one of json or mimedir)

  • Visibility: protected

$forgiving

protected boolean $forgiving = false

Makes the parser less strict.

  • Visibility: protected

$parser

protected mixed $parser
  • Visibility: protected

Methods

main

integer Sabre\VObject\Cli::main(array $argv)

Main function

  • Visibility: public

Arguments

  • $argv array

showHelp

void Sabre\VObject\Cli::showHelp()

Shows the help message.

  • Visibility: protected

validate

integer Sabre\VObject\Cli::validate(\Sabre\VObject\Component $vObj)

Validates a VObject file

  • Visibility: protected

Arguments

repair

integer Sabre\VObject\Cli::repair(\Sabre\VObject\Component $vObj)

Repairs a VObject file

  • Visibility: protected

Arguments

convert

integer Sabre\VObject\Cli::convert(\Sabre\VObject\Component $vObj)

Converts a vObject file to a new format.

  • Visibility: protected

Arguments

color

integer Sabre\VObject\Cli::color(\Sabre\VObject\Component $vObj)

Colorizes a file

  • Visibility: protected

Arguments

colorize

string Sabre\VObject\Cli::colorize(string $color, $str, $resetTo)

Returns an ansi color string for a color name.

  • Visibility: protected

Arguments

  • $color string
  • $str mixed
  • $resetTo mixed

cWrite

void Sabre\VObject\Cli::cWrite(string $color, string $str)

Writes out a string in specific color.

  • Visibility: protected

Arguments

  • $color string
  • $str string

serializeComponent

mixed Sabre\VObject\Cli::serializeComponent(\Sabre\VObject\Component $vObj)
  • Visibility: protected

Arguments

serializeProperty

void Sabre\VObject\Cli::serializeProperty(\Sabre\VObject\Property $property)

Colorizes a property.

  • Visibility: protected

Arguments

parseArguments

void Sabre\VObject\Cli::parseArguments(array $argv)

Parses the list of arguments.

  • Visibility: protected

Arguments

  • $argv array

readInput

\Sabre\VObject\Component Sabre\VObject\Cli::readInput()

Reads the input file

  • Visibility: protected

log

void Sabre\VObject\Cli::log(string $msg, $color)

Sends a message to STDERR.

  • Visibility: protected

Arguments

  • $msg string
  • $color mixed
Clone this wiki locally