Render a set of CLI command references to reStructuredText.

@param array $references to render.
@return void
@throws \Neos\Flow\Mvc\Exception\StopActionException
@throws \Neos\FluidAdaptor\Exception
422846
protected function renderReferences($references)
    {
        foreach ($references as $reference) {
            $this->outputLine('Rendering Reference "%s"', [$reference]);
            $this->renderReference($reference);
        }
    }
1105095
public function renderHeader(array $comments = []) : void
    {
        if ($this->isSilent()) {
            return;
        }

        $this->logger->debug('rendering comments');

        fwrite($this->file, '<comments>' . PHP_EOL);

        foreach ($comments as $text) {
            fwrite($this->file, '<comment><![CDATA[' . $text . ']]></comment>' . PHP_EOL);
        }

        fwrite($this->file, '</comments>' . PHP_EOL);
    }
706554
public function commands($commands)
	{
		$commands = is_array($commands) ? $commands : func_get_args();

		// To register the commands with FlyConsole, we will grab each of the arguments
		// passed into the method and listen for FlyConsole "start" event which will
		// give us the FlyConsole console instance which we will give commands to.
		$events = $this->app['events'];

		$events->listen('flyconsole.start', function($flyconsole) use ($commands)
		{
			$flyconsole->resolveCommands($commands);
		});
	}
490016
protected function _render($params) {
		foreach ($params as $name => $param) {
			if ($name === 'run' || empty($param['name'])) {
				continue;
			}
			$usage = (!empty($param['usage'])) ? trim($param['usage'], ' []') : $param['name'];
			$this->out($this->_pad($usage), 'option');

			if ($param['description']) {
				$this->out($this->_pad($param['description'], 2));
			}
			$this->nl();
		}
	}
1345109
protected function _convertConstraintColumns($references)
    {
        if ($this->_driver->isAutoQuotingEnabled()) {
            if (is_string($references)) {
                return $this->_driver->quoteIdentifier($references);
            }

            return implode(', ', array_map(
                [$this->_driver, 'quoteIdentifier'],
                $references
            ));
        } else {
            if (is_string($references)) {
                return $references;
            }
            return implode(', ', $references);
        }
    }
694403
public function render(array $replacements)
    {
        if (file_exists($this->target)) {
            throw new RuntimeException('Cannot generate file. Target ' . $this->target . ' already exists.');
        }

        $contents = file_get_contents($this->source);

        // Standard replacements
        collect($replacements)->each(function (string $replacement, string $tag) use (&$contents) {
            $contents = str_replace($tag, $replacement, $contents);
        });

        $path = pathinfo($this->target, PATHINFO_DIRNAME);

        if (! file_exists($path)) {
            mkdir($path, 0776, true);
        }

        file_put_contents($this->target, $contents);
    }
153382
protected function registerCommands(array $commands)
    {
        foreach (array_keys($commands) as $command) {
            call_user_func_array([$this, "register{$command}Command"], []);
        }

        $this->commands(array_values($commands));
    }
900150
protected function renderReference($reference)
    {
        if (!isset($this->settings['references'][$reference])) {
            $this->outputLine('Reference "%s" is not configured', [$reference]);
            $this->quit(1);
        }
        $referenceConfiguration = $this->settings['references'][$reference];
        $affectedClassNames = $this->getAffectedClassNames($referenceConfiguration['affectedClasses']);
        $parserClassName = $referenceConfiguration['parser']['implementationClassName'];
        $parserOptions = isset($referenceConfiguration['parser']['options']) ? $referenceConfiguration['parser']['options'] : [];
        /** @var $classParser \Neos\DocTools\Domain\Service\AbstractClassParser */
        $classParser = new $parserClassName($parserOptions);
        $classReferences = [];
        foreach ($affectedClassNames as $className) {
            $classReferences[$className] = $classParser->parse($className);
        }
        usort($classReferences, function (ClassReference $a, ClassReference $b) {
            if ($a->getTitle() == $b->getTitle()) {
                return 0;
            }

            return ($a->getTitle() < $b->getTitle()) ? -1 : 1;
        });
        $standaloneView = new \Neos\FluidAdaptor\View\StandaloneView();
        $templatePathAndFilename = isset($referenceConfiguration['templatePathAndFilename']) ? $referenceConfiguration['templatePathAndFilename'] : 'resource://Neos.DocTools/Private/Templates/ClassReferenceTemplate.txt';
        $standaloneView->setTemplatePathAndFilename($templatePathAndFilename);
        $standaloneView->assign('title', isset($referenceConfiguration['title']) ? $referenceConfiguration['title'] : $reference);
        $standaloneView->assign('classReferences', $classReferences);
        file_put_contents($referenceConfiguration['savePathAndFilename'], $standaloneView->render());
        $this->outputLine('DONE.');
    }
86283
public function renderHeader(array $comments = []) : void
    {
        foreach ($this->writers as $writer) {
            $writer->renderHeader($comments);
        }
    }
618285
protected function render(array $versions)
	{
		$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
		<html>
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
				<title>Joomla Framework pull request log</title>
				</head>
			<body>';

		foreach ($versions as $version)
		{
			// Print the version number.
			$html .= PHP_EOL . '	<h1>' . $version . '</h1>';

			// Print out the labelled version of the changelog first.
			$labelled = $this->getBuffer("$version.labelled");

			if ($labelled)
			{
				foreach ($labelled as $label => $links)
				{
					$html .= PHP_EOL . "<h2>$label</h2>";
					$html .= PHP_EOL . '<ul>';

					foreach ($links as $link)
					{
						$html .= PHP_EOL . "<li>$link</li>";
					}

					$html .= PHP_EOL . '</ul>';
				}
			}

			// Print out the detailed version of the changelog.
			$log = $this->getBuffer("$version.log");
			$html .= PHP_EOL . '<h2>The following pull requests made by community contributors were merged:</h2>';
			$html .= PHP_EOL . '<ol>';

			foreach ($log as $issue)
			{
				$html .= PHP_EOL . "<li>$issue</li>";
			}
			$html .= PHP_EOL . '</ol>';

			// Print out the user-pull statistics.
			$userCount = $this->getBuffer("$version.userCount");
			arsort($userCount);
			$pullCount = $this->getBuffer("$version.pullCount");

			$html .= PHP_EOL . sprintf('<h4>%d pull requests.</h4>', $pullCount);
			$html .= PHP_EOL . '<ol>';

			foreach ($userCount as $user => $count)
			{
				$html .= PHP_EOL . sprintf('<li><a href="https://github.com/%1$s">%1$s</a>: %2$d</li>', $user, $count);
			}
			$html .= PHP_EOL . '	</ol>';

			// Print out the admin-merge statistics.
			$mergedBy = $this->getBuffer("$version.mergedBy");
			arsort($mergedBy);

			$html .= PHP_EOL . '<h4>Merged by:</h4>';
			$html .= PHP_EOL . '<ol>';

			foreach ($mergedBy as $user => $count)
			{
				$html .= PHP_EOL . sprintf('<li><a href="https://github.com/%1$s">%1$s</a>: %2$d</li>', $user, $count);
			}
			$html .= PHP_EOL . '</ol>';
		}

		$html .= PHP_EOL . '</body>';
		$html .= PHP_EOL . '</html>';

		return $html;
	}
1194262
public function Dump( ) {

    /**
      *
      * The method Dump( ) displays the reference graph in textual form
      *
      * Example:
      *
      */


      echo "\nDump für cReferenceGraph";

      for ( $i = 0; $i < count( $this->m_a_references ); $i++ ) {

	echo ( "\n $i  " . $this->m_a_references[$i]->m_table_name . ' ( ' );

	    for ($j = 0; $j <count($this->m_a_references[$i]->m_a_references); $j++) {

		echo " " . $this->m_a_references[$i]->m_a_references[$j]->m_TABLE_NAME;

	    }

	echo ")\n";


      }


  }
223764
protected function displayCommands($commands, $verbosity = 1)
    {
        // Print out command if verbosity level allows it
        if ($verbosity && $this->hasCommand() && ($this->command->getVerbosity() >= $verbosity)) {
            foreach ((array) $commands as $command) {
                $this->explainer->line('$ '.$command, 'magenta');
            }
        }
    }
1216732
public function compileCommand($file = '')
    {
        if (!file_exists($file)) {
            $this->outputLine($file.' not found');
            throw new StopActionException();
        }
        $this->outputLine(DyncssService::getCompiledFile($file));
    }
850653
function attachAndRenderSet (array $components)
  {
    $this->attach ($components);
    foreach ($components as $c)
      $c->run ();
  }
893202
public function highlightCommand($in): void
    {
        // $file = $this->app->getRootPath() . '/examples/routes.php';
        $file = $this->app->getRootPath() . '/src/Utils/Show.php';
        $src  = \file_get_contents($file);

        $code = Highlighter::create()->highlight($src, $in->getBoolOpt('ln'));

        $this->output->writeRaw($code);
    }
1136113
public function render()
    {
        // Count the max command length as column width.
        foreach ($this->items as $item) {
            /** @var $item AbstractCommand */
            $length = strlen($item->getName());

            if ($length > $this->maxLength) {
                $this->maxLength = $length;
            }
        }

        return parent::render();
    }
21519
public function handleModels(array $models)
    {
        $builder = $this->builder;

        $builder->start();

        foreach ($models as $model) {
            $languages = (array)(isset($model->sitemapLanguages) ? $model->sitemapLanguages : Yii::$app->language);

            if (count($languages) > 1) {
                // Handle separately for each language
                foreach ($languages as $language) {
                    // Swith App language to $language
                    if (isset($model->sitemapSwithLanguages) && $model->sitemapSwithLanguages) {
                        static::setLanguage($language);
                    }

                    $this->handleModel($model, $language);

                    // Restore App language
                    static::restoreLanguage();
                }
            } else {
                // Handle only one language
                $this->handleModel($model, null);
            }
        }

        $builder->finish();
    }