Horde_Cli::__construct PHP Method

__construct() public method

Use init() if you also want to set environment variables that may be missing in a CLI environment.
public __construct ( )
    public function __construct()
    {
        $this->_console = $this->runningFromCLI();
        if ($this->_console) {
            $this->_newline = "\n";
            $this->_indent = '    ';
            $term = getenv('TERM');
            if ($term) {
                if (preg_match('/^(xterm|vt220|linux)/', $term)) {
                    $this->_clearscreen = "";
                    $this->_bold_start = "";
                    $this->_red_start = "";
                    $this->_green_start = "";
                    $this->_yellow_start = "";
                    $this->_blue_start = "";
                    $this->_bold_end = $this->_red_end = $this->_green_end = $this->_yellow_end = $this->_blue_end = "";
                } elseif (preg_match('/^vt100/', $term)) {
                    $this->_clearscreen = "";
                    $this->_bold_start = "";
                    $this->_bold_end = "";
                }
            }
        } else {
            $this->_newline = '<br />';
            $this->_indent = str_repeat('&nbsp;', 4);
            $this->_bold_start = '<strong>';
            $this->_bold_end = '</strong>';
            $this->_red_start = '<span style="color:red">';
            $this->_green_start = '<span style="color:green">';
            $this->_yellow_start = '<span style="color:yellow">';
            $this->_blue_start = '<span style="color:blue">';
            $this->_red_end = $this->_green_end = $this->_yellow_end = $this->_blue_end = '</span>';
        }
        // We really want to call this at the end of the script, not in the
        // destructor.
        if ($this->_console) {
            register_shutdown_function(array($this, 'shutdown'));
        }
    }