Report the content of the global composer library directory

@param PrintStream $out the stream to print the content to
553872
private static function doReportComposerSystemLibraries(PrintStream $out)
    {
        $libs = self::listLibraries('platform');
        self::printLibraries($libs, $out);
    }
863464
protected function writeComposerFile($composer)
    {
        file_put_contents(
            $this->command->path.'/composer.json',
            json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
        );
    }
335607
public void reportSummary(@WillClose OutputStream out) throws IOException {
        XMLOutput xmlOutput = new OutputStreamXMLOutput(out);
        try {
            writeXML(xmlOutput);
        } finally {
            xmlOutput.finish();
        }
    }
1333024
function output ( $_top = '' )
		{
			global $_top;

			//	Make sure that folder names have a trailing '/'
			if (strlen($this->template_dir)  &&  substr($this->template_dir, -1) != '/')
			{
				$this->template_dir  .=  '/';
			}
			if (strlen($this->temp_dir)  &&  substr($this->temp_dir, -1) != '/')
			{
				$this->temp_dir  .=  '/';
			}
			//	Prepare Template Content
			if (!is_array($_top))
			{
				if (strlen($_top))
				{
					$this->tpl_file  =  $_top;
				}
				$_top  =  $this->data;
			}
			$_obj  =  &$_top;
			$_stack_cnt  =  0;
			$_stack[$_stack_cnt++]  =  $_obj;

			//	Check if template is already compiled
			$cpl_file_name = preg_replace('/[:\/.\\\\]/', '_', $this->tpl_file);
			if (strlen($cpl_file_name) > 0)
			{
	    		$this->cpl_file  =  $this->temp_dir . $cpl_file_name . '.php';
				$compile_template  =  true;
				if ($this->reuse_code)
				{
					if (is_file($this->cpl_file))
					{
						if ($this->mtime($this->cpl_file) > $this->mtime($this->template_dir . $this->tpl_file))
						{
							$compile_template  =  false;
						}
					}
				}
				if ($compile_template)
				{
					if (@include_once("class.smarttemplateparser.php"))
					{
						$this->parser = new SmartTemplateParser($this->template_dir . $this->tpl_file);
						if (!$this->parser->compile($this->cpl_file))
						{
							exit( "SmartTemplate Parser Error: " . $this->parser->error );
						}
					}
					else
					{
						exit( "SmartTemplate Error: Cannot find class.smarttemplateparser.php; check SmartTemplate installation");
					}
				}
				//	Execute Compiled Template
				include($this->cpl_file);
			}
			else
			{
				exit( "SmartTemplate Error: You must set a template file name");
			}
			//	Delete Global Content Array in order to allow multiple use of SmartTemplate class in one script
			unset ($_top);
		}
297943
public static void writeGzipObjectToStream(final Object o, OutputStream out) {
    out = new BufferedOutputStream(out);
    try {
      out = new GZIPOutputStream(out, true);
      final ObjectOutputStream oos = new ObjectOutputStream(out);
      oos.writeObject(o);
      oos.flush();
    } catch (final IOException e) {
      e.printStackTrace();
    }
  }
196852
private function endOutputBuffer($output = null): void
    {
        // handle redirections
        $statusCode = $this->response->status()->getCode();
        if ($statusCode >= 300 && $statusCode <= 399) {
            // clean & turn off output buffering
            while (ob_get_level()) {
                ob_end_clean();
            }
            $this->response->body()->setContentType('none');
        }
        // handle outputs
        else {
            // echo'd or print'ed service methods return 'null'
            if ($output === null) {
                $output = '';
                while (ob_get_level()) {
                    $output .= ob_get_clean();
                }
            }

            // call user output handler if provided
            if ($this->events->has('app.output')) {
                $output = $this->events->fire('app.output', $output);
            }

            $this->response->setBody($output);
        }

        $this->response->end();
    }
110192
public void dumpTo(AreaTree tree, PrintWriter out)
    {
        if (produceHeader)
            out.println("<?xml version=\"1.0\"?>");
        out.println("<areaTree base=\"" + HTMLEntities(tree.getRoot().getPage().getSourceURL().toString()) + "\">");
        recursiveDump(tree.getRoot(), 1, out);
        out.println("</areaTree>");
    }
133069
@Override
	public void print(final MBasicTable table, final OutputStream out) throws IOException {
		writePdf(table, out);
	}
277443
public void writeTo(OutputStream out) throws TLVParserException {
        Util.notNull(out, "Output stream");
        try {
            assertActualContentLengthIsInTLVLimits(getContentLength());
            out.write(encodeHeader());
            out.write(getContent());
        } catch (IOException e) {
            throw new TLVParserException("Writing TLV element (" + convertHeader() + ")  to output stream failed", e);
        }
    }
987796
protected function _writeBackDataOut($out, $data)
    {
        $buck = stream_bucket_new($this->bufferHandle, '');
        if (false === $buck)
            // trigger filter error
            return PSFS_ERR_FATAL;

        $buck->data = $data;
        stream_bucket_append($out, $buck);

        // data was processed successfully
        return PSFS_PASS_ON;
    }
711588
public function export()
    {
        if ( ! is_dir($this->_outputDir)) {
            mkdir($this->_outputDir, 0775, true);
        }

        foreach ($this->_metadata as $metadata) {
            // In case output is returned, write it to a file, skip otherwise
            if($output = $this->exportClassMetadata($metadata)){
                $path = $this->_generateOutputPath($metadata);
                $dir = dirname($path);
                if ( ! is_dir($dir)) {
                    mkdir($dir, 0775, true);
                }
                if (file_exists($path) && !$this->_overwriteExistingFiles) {
                    throw ExportException::attemptOverwriteExistingFile($path);
                }
                file_put_contents($path, $output);
                chmod($path, 0664);
            }
        }
    }
540397
public function renderReports(OutputInterface $output, SuiteCollection $collection, array $reportNames, array $outputNames)
    {
        $reportDoms = $this->generateReports($collection, $reportNames);

        foreach ($outputNames as $outputName) {
            $outputConfig = $this->rendererRegistry->getConfig($outputName);
            $renderer = $this->rendererRegistry->getService($outputConfig['renderer']);
            assert($renderer instanceof RendererInterface);

            // set the output instance if the renderer requires it.
            if ($renderer instanceof OutputAwareInterface) {
                $renderer->setOutput($output);
            }

            foreach ($reportDoms as $reportDom) {
                $renderer->render($reportDom->duplicate(), $outputConfig);
            }
        }
    }
109425
public function serialize($resource, OutputStream $out): OutputStream
    {
        $out->write((string) $resource);
        return $out;
    }
488791
public function write(OutputInterface $output): void
    {
        $outputPath = $this->outputDir.'/'.$output->permalink()->relativeFilePath();
        if ($output->hasFileReference()) {
            $this->filesystem->copy($output->file(), $outputPath, true);
        } else {
            $this->filesystem->mkdir(dirname($outputPath));
            $this->filesystem->dumpFile($outputPath, $output->formattedContent());
        }
    }
807971
public function writeStdout($out, $phase = PHP_OUTPUT_HANDLER_END)
    {
        $isCleaning = $phase & PHP_OUTPUT_HANDLER_CLEAN;

        // Incremental flush
        if ($out !== '' && !$isCleaning) {
            $this->output->write($out, false, ShellOutput::OUTPUT_RAW);
            $this->outputWantsNewline = (\substr($out, -1) !== "\n");
            $this->stdoutBuffer .= $out;
        }

        // Output buffering is done!
        if ($phase & PHP_OUTPUT_HANDLER_END) {
            // Write an extra newline if stdout didn't end with one
            if ($this->outputWantsNewline) {
                $this->output->writeln(\sprintf('<aside>%s</aside>', $this->config->useUnicode() ? '⏎' : '\\n'));
                $this->outputWantsNewline = false;
            }

            // Save the stdout buffer as $__out
            if ($this->stdoutBuffer !== '') {
                $this->context->setLastStdout($this->stdoutBuffer);
                $this->stdoutBuffer = '';
            }
        }
    }
1109070
public function serialize($resource, OutputStream $out): OutputStream
    {
        if (is_scalar($resource) || $resource instanceof Error) {
            $out->writeLine((string) $resource);
        } elseif (is_array($resource) || $resource instanceof \Traversable) {
            $this->serializeIterable($resource, $out);
        } elseif (is_object($resource)) {
            $this->serializeIterable(castToArray($resource), $out);
        } else {
            trigger_error(
                    'Resource of type ' . typeOf($resource)
                    . ' can not be serialized to csv',
                    E_USER_ERROR
            );
        }

        return $out;
    }
1063
public static void writeClassToStream(Class<?> cl, OutputStream out) throws IOException {
    InputStream in = getClassAsStream(cl);
    StreamUtil.writeStream(in, out);
    out.flush();
  }