/**
  * @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";
     }
 }
Example #2
0
 private function saveWordPressSpecificInfo($bugReportDir)
 {
     $info = SystemInfo::getWordPressInfo();
     $serializedInfo = var_export($info, true);
     file_put_contents($bugReportDir . '/info.ini', $serializedInfo);
 }
Example #3
0
<?php

use Utils\SystemInfo;
use VersionPress\Utils\RequirementsChecker;
defined('ABSPATH') or die("Direct access not allowed");
$outputFormat = isset($_GET['f']) ? $_GET['f'] : null;
$supportedOutputFormats = array('ve', 'tc');
if (!in_array($outputFormat, $supportedOutputFormats)) {
    $outputFormat = $supportedOutputFormats[0];
}
$systemInfo = SystemInfo::getAllInfo();
function displaySystemInfoArray($array)
{
    global $outputFormat;
    switch ($outputFormat) {
        case 've':
            // var_export
            echo '<pre><code style="language-php">';
            echo htmlspecialchars(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>