You are currently viewing the 0.10 branch api documentation. Switch to 1.0 or 1.1

0.10 Doctrine_Cli_AnsiColorFormatter

Doctrine Cli AnsiColorFormatter

Doctrine_AnsiColorFormatter provides methods to colorize text to be displayed on a console.

Inheritence

Doctrine_Cli_AnsiColorFormatter  < Doctrine_Cli_Formatter

Method Summary

Returns Name Description
string excerpt
string format
formatSection
setStyle
Boolean supportsColors Colorization is disabled if not supported by the stream:
  • windows

  • non tty consoles


Method Details

  • $text The text
    $size The maximum size of the returned string (65 by default)

    (string) excerpt($text, $size = null)

    Truncates a line.

    Doctrine_Cli_AnsiColorFormatter


  • $text The test to style
    $parameters An array of options or a style name

    (string) format($text = '', $parameters = array(), $stream = STDOUT)

    Formats a text according to the given style or parameters.

    Doctrine_Cli_AnsiColorFormatter


  • $section The section name
    $text The text message
    $size The maximum size allowed for a line (65 by default)

    formatSection($section, $text, $size = null)

    Formats a message within a section.


  • $name The style name
    $options An array of options

    setStyle($name, $options = array())

    Sets a new style.


  • $stream A stream

    (Boolean) supportsColors($stream)

    Returns true if the stream supports colorization.

    Colorization is disabled if not supported by the stream:



    • windows




    • non tty consoles



    Doctrine_Cli_AnsiColorFormatter