lithium\console\Response::__construct PHP Method

__construct() public method

Constructor.
public __construct ( array $config = [] ) : void
$config array Available configuration options are: - `'output'` _resource|null_ - `'error'` _resource|null_
return void
    public function __construct($config = array())
    {
        $defaults = array('output' => null, 'error' => null);
        $config += $defaults;
        $this->output = $config['output'];
        if (!is_resource($this->output)) {
            $this->output = fopen('php://stdout', 'r');
        }
        $this->error = $config['error'];
        if (!is_resource($this->error)) {
            $this->error = fopen('php://stderr', 'r');
        }
        parent::__construct($config);
    }

Usage Example

Example #1
0
 public function __construct(array $config = array())
 {
     parent::__construct($config);
     $this->output = null;
     $this->error = null;
 }