TODO

@param $output
165505
public function exec($output)
    {
        $this->writer->open($output);
        foreach ($this->models as $model) {
            if ($this->filter === false || $this->filter->filter($model)) {
                $this->writer->write($model, $this->associations);
            }
        }
        $this->writer->close();
    }
924386
public function innerCommand($output)
    {
        if ($this->output->isVeryVerbose()) {
            $this->write($output);
        }

        if (!$this->output->isVeryVerbose()) {
            $this->outputBuffer[] = $output;
        }
    }
68460
private function initACL($output)
    {
        $command = $this->getApplication()->find('acl:init');

        $arguments = [
            'command' => 'acl:init',
        ];

        $input = new ArrayInput($arguments);

        return $command->run($input, $output);
    }
437015
protected function set_cache( string $output ) : bool {
		return set_transient( $this->cache_key(), $output, $this->args['cache'] );
	}
459494
public function run(Input $input, Output $output) {
        $this->input = $input;
        $this->output = $output;

        $this->getSynopsis(true);
        $this->getSynopsis(false);

        $this->mergeConsoleDefinition();

        try {
            $input->bind($this->definition);
        }
        catch (\Exception $e) {
            if (!$this->ignoreValidationErrors) {
                throw $e;
            }
        }

        $this->initialize($input, $output, $this);

        if ($input->isInteractive()) {
            $this->interact($input, $output, $this);
        }

        $input->validate();

        if ($this->code) {
            $statusCode = call_user_func($this->code, $input, $output);
        }
        else {
            $statusCode = $this->execute($input, $output, $this);
        }

        return is_numeric($statusCode) ? (int)$statusCode : 0;
    }
130212
public function save($output, array $options = []) {
		$this->_image->save($output, $options);
		$this->_image = null;
		return true;
	}
63685
public function output($flags = 0x00003) {
    if (($flags & self::OUTPUT_HEADER) == self::OUTPUT_HEADER) {
      $this->sendHeaders();
    }
    
    if ($this->outputClosure instanceof \Closure) {
      $c = $this->outputClosure;
      $c();
      return;
    }
    
    if (($flags & self::OUTPUT_BODY) == self::OUTPUT_BODY) {
      print $this->body;
    }
  }
352491
public function finalize($output=null)
	{
	    $response = $this->getResponse();
	    if ($output instanceof ResponseInterface) {
	        $response = $output;
	    } elseif (is_string($output) && !empty($output) && $response->getBody()->isWritable()) {
	        if (Config::getCommon('response.outputBuffering') === 'prepend') {
	            // prepend output buffer content
	            $body = new Body(fopen('php://temp', 'r+'));
	            $body->write($output . $response->getBody());
	            $response = $response->withBody($body);
	        } else {
	            // append output buffer content
	            $response->getBody()->write($output);
	        }
	    }
	    
	    // stop PHP sending a Content-Type automatically
	    ini_set('default_mimetype', '');
	    
	    if ($this->isEmptyResponse($response)) {
	        return $response->withoutHeader('Content-Type')->withoutHeader('Content-Length');
	    }
	    
	    if (!$response->hasHeader('Content-Type')) {
	        $response = $response->withHeader('Content-Type', 'text/html; charset=UTF-8');
	    }
	    
	    // Add Content-Length header if `addContentLengthHeader` is set
	    if (Config::getCommon('response.addContentLengthHeader')) {
	        if (ob_get_length() > 0) {
	            throw new \RuntimeException("Unexpected data in output buffer. " .
	                "Maybe you have characters before an opening <?php tag?");
	        }
	        
	        $size = $response->getBody()->getSize();
	        if ($size !== null && !$response->hasHeader('Content-Length')) {
	            $response = $response->withHeader('Content-Length', (string) $size);
	        }
	    }
	    
	    return $response;
	}
1259846
public function setOutput($output)
    {
        $prev = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;

        if (\is_callable($output)) {
            $this->outputStream = null;
            $this->lineDumper = $output;
        } else {
            if (\is_string($output)) {
                $output = fopen($output, 'wb');
            }
            $this->outputStream = $output;
            $this->lineDumper = [$this, 'echoLine'];
        }

        return $prev;
    }
1183977
public static function set_debug($toggle, $output = "stdout") {
    if ($toggle) {
      self::$debug = $output;
    }
    else {
      self::$debug = false;
    }
  }
873370
public function setHandler($output)
	{
		$this->_whoops->popHandler();

		if ($output == OutputData::Json)
		{
			$this->_handler = new JsonResponseHandler();
		}
		else if ($output == OutputData::Xml)
		{
			$this->_handler = new XmlResponseHandler();
		}
		else
		{
			$this->_handler = new PrettyPageHandler();
			if (!Context::getInstance()->getDevelopmentStatus())
			{
				$this->_handler->addResourcePath(\WhoopsResources\Resource::getPath());
			}
		}

		$this->_whoops->pushHandler($this->_handler);
	}
386661
public function setOutput($output, ? string $wrapper = null)
    {
        if ($wrapper) {
            $this->setOutputWrapper($wrapper);
        }

        return tap($this, function ($instance) use ($output) {
            $instance->output = $output;
        });
    }
50884
public function output($output)
    {
        $this->_output = $output;
        $request       = Craft::$app->getRequest();
        $response      = Craft::$app->getResponse();

        if (!$this->isPJAX() || $request->isCpRequest || $request->isLivePreview || $request->isConsoleRequest) {
            return $this->_output;
        }

        $this->filterResponse($this->_output, $request->headers->get('X-PJAX-Container'))
             ->setUriHeader($request, $response)
             ->setVersionHeader($output, $response);

        return $this->_output;
    }
112066
public function getOutputFilename($output)
	{
		// default behaviour / backwards compatibility
		$outputDir = $output;
		$outputFilename = $this->getDefaultOutputFilename();

		// Find out if a .htm(l) filename has been given in the output argument.
		if ($this->endsWith($output, ".htm") || $this->endsWith($output, ".html")) {
			$outputDir = dirname($output);
			$outputFilename = basename($output);
		}

		return $outputDir . DIRECTORY_SEPARATOR . $outputFilename;
	}
751015
protected function echoMessage($out)
    {
        if ($this->output) {
            if ($this->output->getVerbosity() >= $this->minVerbosityLevel) {
                $this->output->writeln($out);
            }
        }

        if ($this->logger) {
            $this->logger->debug($out);
        }
    }
290108
private function writeToOutputNow($output)
    {
        if ($this->sendHttpCode() && \Whoops\Util\Misc::canSendHeaders()) {
            $httpCode   = $this->sendHttpCode();

            if (function_exists('http_response_code')) {
                http_response_code($httpCode);
            } else {
                // http_response_code is added in 5.4.
                // For compatibility with 5.3 we use the third argument in header call
                // First argument must be a real header.
                // If it is empty, PHP will ignore the third argument.
                // If it is invalid, such as a single space, Apache will handle it well,
                // but the PHP development server will hang.
                // Setting a full status line would require us to hardcode
                // string values for all different status code, and detect the protocol.
                // which is an extra error-prone complexity.
                header('X-Ignore-This: 1', true, $httpCode);
            }
        }

        echo $output;

        return $this;
    }
1164701
protected function write(OutputInterface $output, array $result = null)
    {
        if ($result === null) {
            return;
        }

        foreach ($result as $label => $items) {
            $names = \array_map([$this, 'formatItemName'], $items);
            $output->writeln(\sprintf('<strong>%s</strong>: %s', $label, \implode(', ', $names)));
        }
    }