Exemple #1
0
}
if (isset($opt['clear-cache'])) {
    // clear cache
    $f = $opt['clear-cache'];
    $re = clearCache($dir, $f);
} else {
    // install modules
    $modules = [];
    // core
    $m_core = 'core';
    if (isset($opt['m-core'])) {
        if (!boolval($opt['m-core'])) {
            $m_core = '';
        }
    }
    if ($m_core) {
        array_push($modules, $m_core);
    }
    $modules = checkModules($opt, $modules);
    $re = installModules($modules, $dir);
    if ($re === 0) {
        echo "Install successfully!\n";
        // unmask
        $out = [];
        exec('php ' . __DIR__ . DIRECTORY_SEPARATOR . 'maskphp.php' . " -d {$dir} --unmask", $out);
        foreach ($out as $l) {
            echo "{$l}\n";
        }
    }
}
exit($re);
Exemple #2
0
sort($apacheMods, SORT_STRING | SORT_FLAG_CASE);
sort($phpExt, SORT_STRING | SORT_FLAG_CASE);
$mysqli = new mysqli("localhost", "root", "vagrant");
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit;
}
$mysqlServerinfo = $mysqli->server_info;
$mysqlClientinfo = $mysqli->client_info;
$mysqli->close();
$isLinfo = checkModules("linfo/");
$linfoVers = "3.0.1";
$isAdminer = checkModules("adminer.php");
$adminerVers = "4.2.5";
$isInfo = checkModules("info.php");
$isBench = checkModules("benchmark.php");
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title><?php 
echo $_SERVER['HTTP_HOST'];
?>
</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Basic LAMP Vagrant machine with PHP <?php 
echo phpversion();
?>
">
    <meta name="author" content="Csaba Maulis">