Display a warning about installing development code if necesary.
@param int $maturity
@return string HTML to output.
177108
protected function maturity_info($maturity) {
        if ($maturity == MATURITY_STABLE) {
            return ''; // No worries.
        }

        $level = 'warning';

        if ($maturity == MATURITY_ALPHA) {
            $level = 'error';
        }

        $maturitylevel = get_string('maturity' . $maturity, 'admin');
        $warningtext = get_string('maturitycoreinfo', 'admin', $maturitylevel);
        $warningtext .= ' ' . $this->doc_link('admin/versions', get_string('morehelp'));
        return $this->warning($warningtext, $level);
    }
395445
public function showVersionInfo(): void
    {
        $os         = \PHP_OS;
        $date       = \date('Y.m.d');
        $logo       = '';
        $name       = $this->getParam('name', 'Console Application');
        $version    = $this->getParam('version', 'Unknown');
        $publishAt  = $this->getParam('publishAt', 'Unknown');
        $updateAt   = $this->getParam('updateAt', 'Unknown');
        $phpVersion = \PHP_VERSION;

        if ($logoTxt = $this->getLogoText()) {
            $logo = ColorTag::wrap($logoTxt, $this->getLogoStyle());
        }

        /** @var \Inhere\Console\IO\Output $out */
        $out = $this->output;
        $out->aList([
            "$logo\n  <info>{$name}</info>, Version <comment>$version</comment>\n",
            'System Info'      => "PHP version <info>$phpVersion</info>, on <info>$os</info> system",
            'Application Info' => "Update at <info>$updateAt</info>, publish at <info>$publishAt</info>(current $date)",
        ], null, [
            'leftChar' => '',
            'sepChar'  => ' :  '
        ]);
    }
171333
public function management_message($message) {
        $this->page->requires->strings_for_js(array('clicktoclose'), 'core_grading');
        $this->page->requires->yui_module('moodle-core_grading-manage', 'M.core_grading.init_manage');
        return $this->output->box(format_string($message) . ' - ' . html_writer::tag('span', ''), 'message',
                'actionresultmessagebox');
    }
780286
private function displayInstallationResult()
    {
        if (empty($this->requirementsErrors)) {
            $this->output->writeln(sprintf(
                " <info>%s</info>  Symfony Demo Application was <info>successfully installed</info>. Now you can:\n",
                defined('PHP_WINDOWS_VERSION_BUILD') ? 'OK' : '✔'
            ));
        } else {
            $this->output->writeln(sprintf(
                " <comment>%s</comment>  Symfony Demo Application was <info>successfully installed</info> but your system doesn't meet the\n".
                "     technical requirements to run Symfony applications! Fix the following issues before executing it:\n",
                defined('PHP_WINDOWS_VERSION_BUILD') ? 'FAILED' : '✕'
            ));

            foreach ($this->requirementsErrors as $helpText) {
                $this->output->writeln(' * '.$helpText);
            }

            $this->output->writeln(sprintf(
                " After fixing these issues, re-check Symfony requirements executing this command:\n\n".
                "   <comment>php %s/bin/symfony_requirements</comment>\n\n".
                " Then, you can:\n",
                $this->projectName
            ));
        }

        $serverRunCommand = extension_loaded('pcntl') ? 'server:start' : 'server:run';

        $this->output->writeln(sprintf(
            "    1. Change your current directory to <comment>%s</comment>\n\n".
            "    2. Execute the <comment>php bin/console %s</comment> command to run the demo application.\n\n".
            "    3. Browse to the <comment>http://localhost:8000</comment> URL to see the demo application in action.\n\n",
            $this->projectDir, $serverRunCommand
        ));

        $this->output->writeln(
            "<bg=yellow> WARNING </>\n\n".
            "   This installer downloads the old Symfony Demo version based on Symfony 3.\n".
            "   If you prefer to install the new version based on Symfony 4 and Symfony Flex,\n".
            "   execute the following command:\n\n".
            "     composer create-project symfony/symfony-demo\n");

        return $this;
    }
148741
private function render() : string
    {
        $styles = $this->styles();
        if (strlen($styles) > 0) {
            $styles = 'style="' . $this->view->escapeHtmlAttr(trim($styles)) . '"';
        }

        return '
            <div class="progress">
                <div class="progress-bar' . $this->classes() . '" role="progressbar" ' . $styles .
            ' aria-valuenow="' . $this->value . '" aria-valuemin="0" aria-valuemax="100">' .
            (($this->label !== null) ? $this->view->escapeHtml($this->label) : null) . '</div>
            </div>';
    }
1100874
protected function buildInlineCode() {
        $result = '';
        if (!$this->events->isEmpty()) {
            $variableName = $this->getTimersVariableName();

            $result = 'foreach (Time => Name in ' . $variableName . ') {' . PHP_EOL
                . '    if (Time <= CurrentTime) {' . PHP_EOL
                . '        switch (Name) {' . PHP_EOL;

            foreach ($this->events as $event) {
                /* @var $event \ManiaScript\Builder\Event\Timer */
                $result .= '            case "' . $event->getName() . '": {' . PHP_EOL;
                if ($event->getInline()) {
                    $result .= $event->getCode() . PHP_EOL;
                } else {
                    $result .= '                ' . $this->buildHandlerFunctionCall($event) . PHP_EOL;
                }
                $result .= '            }' . PHP_EOL;
            }

            $result .= '        }' . PHP_EOL
                . '        declare Temp = ' . $variableName . '.removekey(Time);' . PHP_EOL
                . '    }' . PHP_EOL
                . '}' . PHP_EOL;
        }
        return $result;
    }
828483
protected function showFatalError()
    {
        $error = error_get_last();
        switch ($error['type']) {
            case E_ERROR:
            case E_CORE_ERROR:
            case E_COMPILE_ERROR:
            case E_USER_ERROR:
            case E_RECOVERABLE_ERROR:
            case E_CORE_WARNING:
            case E_COMPILE_WARNING:
            case E_PARSE:
                ob_clean();
                echo $this->htmlReport([
                    'mode' => 'fatal',
                    'error' => 'Error while building pages',
                    'summary' => $this->summary,
                    'errorTitle' => 'Failed to build page <code>' . $this->lastpage . '</code>',
                    'errorDetails' => $error['message'] . "<br>\n"
                        . 'In ' . $error['file'] . ', line ' . $error['line']
                ]);
        }
    }
978500
protected function ide()
    {
        foreach ($this->readdmesg() as $line) {
            if (preg_match('/^(ad[0-9]+): (.*)MB <(.*)> (.*) (.*)/', $line, $ar_buf)) {
                $dev = new HWDevice();
                $dev->setName($ar_buf[1].": ".trim($ar_buf[3]));
                if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
                    $dev->setCapacity($ar_buf[2] * 1024 * 1024);
                }
                $this->sys->setIdeDevices($dev);
            } elseif (preg_match('/^(acd[0-9]+): (.*) <(.*)> (.*)/', $line, $ar_buf)) {
                $dev = new HWDevice();
                $dev->setName($ar_buf[1].": ".trim($ar_buf[3]));
                $this->sys->setIdeDevices($dev);
            } elseif (preg_match('/^(ada[0-9]+): <(.*)> (.*)/', $line, $ar_buf)) {
                $dev = new HWDevice();
                $dev->setName($ar_buf[1].": ".trim($ar_buf[2]));
                $this->sys->setIdeDevices($dev);
            } elseif (preg_match('/^(ada[0-9]+): (.*)MB \((.*)\)/', $line, $ar_buf)) {
                /* duplication security */
                $notwas = true;
                foreach ($this->sys->getIdeDevices() as $finddev) {
                    if ($notwas && (substr($finddev->getName(), 0, strpos($finddev->getName(), ': ')) == $ar_buf[1])) {
                        if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
                            $finddev->setCapacity($ar_buf[2] * 1024 * 1024);
                        }
                        $notwas = false;
                        break;
                    }
                }
                if ($notwas) {
                    $dev = new HWDevice();
                    $dev->setName($ar_buf[1]);
                    if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
                        $dev->setCapacity($ar_buf[2] * 1024 * 1024);
                    }
                    $this->sys->setIdeDevices($dev);
                }
            } elseif (preg_match('/^(ada[0-9]+): Serial Number (.*)/', $line, $ar_buf)) {
                /* duplication security */
                $notwas = true;
                foreach ($this->sys->getIdeDevices() as $finddev) {
                    if ($notwas && (substr($finddev->getName(), 0, strpos($finddev->getName(), ': ')) == $ar_buf[1])) {
                        if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS
                           && defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL) {
                            $finddev->setSerial(trim($ar_buf[2]));
                        }
                        $notwas = false;
                        break;
                    }
                }
                if ($notwas) {
                    $dev = new HWDevice();
                    $dev->setName($ar_buf[1]);
                    if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS
                       && defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL) {
                        $finddev->setSerial(trim($ar_buf[2]));
                    }
                    $this->sys->setIdeDevices($dev);
                }
            }
        }
        /* cleaning */
        foreach ($this->sys->getIdeDevices() as $finddev) {
                    if (strpos($finddev->getName(), ': ') !== false)
                        $finddev->setName(substr(strstr($finddev->getName(), ': '), 2));
        }
    }
3072
public function getEmbedHtml () : string
    {
        if (null === $this->assetHelper && null === $this->packages)
        {
            throw new AssetIntegrationFailedException("No asset integration extension found. Please either install `becklyn/assets-bundle` or `symfony/asset` to use this bundle.");
        }

        $trackJsToken = $this->hostingConfig->getTrackJsToken();

        // only embed if token is set, in production and not in debug
        if (null === $trackJsToken || $this->isDebug || "prod" !== $this->environment)
        {
            return "";
        }

        $assetUrl = null !== $this->assetHelper
            ? $this->assetHelper->getUrl("@hosting/js/trackjs.js")
            : $this->packages->getUrl("bundles/becklynhosting/js/trackjs.js");

        return \sprintf(
            '<script src="%s"></script><script>window.TrackJS && TrackJS.install(%s)</script>',
            $assetUrl,
            \json_encode([
                "token" => $trackJsToken,
                "application" => $this->hostingConfig->getProjectName(),
                "version" => $this->hostingConfig->getGitCommit(),
                "console" => [
                    "display" => false,
                ],
            ])
        );

    }
196159
public function makeAddDebug(){
		$s = "";
		foreach ($this->headers as $code){
			$s .= '$( document ).ready(function() {'."\n";
			$s .= $code;
			$s .= "\n});\n\n";
		}
		return $s;
	}
1120047
protected function render() : string
    {
        $styles = $this->styles();
        if (strlen($styles) > 0) {
            $styles = 'style="' . trim($styles) . '"';
        }

        return '<div class="progress"><div class="progress-bar' . $this->classes() .
            '" role="progressbar" ' . $styles . ' aria-valuenow="' . $this->value .
            '" aria-valuemin="0" aria-valuemax="100">' .
            (($this->label !== null) ? $this->label : null) . '</div></div>';
    }
40983
public function render() : string
    {
        $html = '<div id="app">';
        $html .= '
            <transition name="fade" mode="out-in">
                <router-view></router-view>
            </transition>';
        $html .= '</div>';
        $title = env('APP_NAME');
        $html .= '<script src="/assets/application.js"></script>';
        $html .= $this->scripts();
        return '<body>' . $html . '</body>';
    }
1153976
final public static function displayAsError(string $message, string $exit = "yes")
    {
        $colors = self::getManagerColorInstance();
        echo "\n\n".$colors->getColoredString($message, "red", "transparent");
        if ($exit == "yes") {
            exit();
        }
    }
510234
public static function displayNotices()
    {
        if ($notices = get_option('staticwp_deferred_admin_notices')) {
            foreach ($notices as $notice) {
                $message = $notice;
                $type = 'updated';

                if (is_array($notice)) {
                    $message = isset($notice['message']) ? $notice['message'] : '';
                    $type = isset($notice['type']) ? $notice['type'] : $type;
                }

                echo '<div class="' . $type . '"><p>' . $message . '</p></div>';
            }
            delete_option('staticwp_deferred_admin_notices');
        }
    }
16329
function toHtml(){
        global $OUTPUT;

        $managelink = '';
        if (has_capability('moodle/tag:manage', context_system::instance()) && $this->showstandard) {
            $url = new moodle_url('/tag/manage.php', array('tc' => $this->get_tag_collection()));
            $managelink = ' ' . $OUTPUT->action_link($url, get_string('managestandardtags', 'tag'));
        }

        return parent::toHTML() . $managelink;
    }
135539
protected static function showFailed()
    {
        \cli\line();
        \cli\line(
            \cli\Colors::colorize('%N%n%1Installation of ' . self::PROJECT_NAME_SHORT . ' failed.%N%n')
        );
    }
730215
public function format(Version $version)
    {
        if (preg_match('/^(\d+)-g([a-fA-F0-9]{7,40})(-dirty)?$/', $version->getPreRelease(), $matches)) {
            if ((int) $matches[1] != 0) {
                // we are not on TAG commit, add "dev" and git commit hash as pre release part
                $version = $version->withPreRelease(array('dev', $matches[2]));
            } else {
                $version = $version->withPreRelease(array());
            }
        }

        if (preg_match('/^(.*)-(\d+)-g([a-fA-F0-9]{7,40})(-dirty)?$/', $version->getPreRelease(), $matches)) {
            if ((int) $matches[2] != 0) {
                // we are not on TAG commit, add "dev" and git commit hash as pre release part
                if (empty($matches[1])) {
                    $version = $version->withPreRelease(array('dev', $matches[3]));
                } else {
                    $version = $version->withPreRelease(array_merge(explode('.', trim($matches[1], '-')), array('dev', $matches[3])));
                }
            } else {
                if (empty($matches[1])) {
                    $version = $version->withPreRelease(array());
                } else {
                    $version = $version->withPreRelease(trim($matches[1], '-'));
                }
            }
        }

        return $version;
    }