コード例 #1
0
 /**
  * @return string "ok", "no-git" or "wrong-version"
  */
 private function tryGit()
 {
     try {
         $gitVersion = SystemInfo::getGitVersion();
         return self::gitMatchesMinimumRequiredVersion($gitVersion) ? "ok" : "wrong-version";
     } catch (Exception $e) {
         return "no-git";
     }
 }
コード例 #2
0
<?php

use VersionPress\Utils\SystemInfo;
defined('ABSPATH') or die("Direct access not allowed");
$outputFormat = isset($_GET['f']) ? $_GET['f'] : null;
$supportedOutputFormats = ['ve', 'tc'];
if (!in_array($outputFormat, $supportedOutputFormats)) {
    $outputFormat = $supportedOutputFormats[0];
}
$systemInfo = SystemInfo::getAllInfo();
function vp_display_system_info_array($array, $outputFormat)
{
    switch ($outputFormat) {
        case 've':
            // var_export
            echo '<pre><code style="language-php">';
            echo esc_html(var_export($array, true));
            echo '</code></pre>';
            break;
        case 'tc':
            \Tracy\Debugger::dump($array);
            break;
    }
}
?>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script>
    hljs.configure({languages: []}); // disable automatic language detection
    hljs.initHighlightingOnLoad();