mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-03-01 15:21:02 +03:00
72 lines
1.5 KiB
PHP
72 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* Zend Framework (http://framework.zend.com/)
|
|
*
|
|
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
|
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
|
* @license http://framework.zend.com/license/new-bsd New BSD License
|
|
*/
|
|
|
|
namespace Zend\View\Model;
|
|
|
|
class ConsoleModel extends ViewModel
|
|
{
|
|
const RESULT = 'result';
|
|
|
|
/**
|
|
* Console output doesn't support containers.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $captureTo = null;
|
|
|
|
/**
|
|
* Console output should always be terminal.
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $terminate = true;
|
|
|
|
/**
|
|
* Set error level to return after the application ends.
|
|
*
|
|
* @param int $errorLevel
|
|
*/
|
|
public function setErrorLevel($errorLevel)
|
|
{
|
|
$this->options['errorLevel'] = $errorLevel;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getErrorLevel()
|
|
{
|
|
if (array_key_exists('errorLevel', $this->options)) {
|
|
return $this->options['errorLevel'];
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Set result text.
|
|
*
|
|
* @param string $text
|
|
* @return \Zend\View\Model\ConsoleModel
|
|
*/
|
|
public function setResult($text)
|
|
{
|
|
$this->setVariable(self::RESULT, $text);
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get result text.
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function getResult()
|
|
{
|
|
return $this->getVariable(self::RESULT);
|
|
}
|
|
}
|