xref: /webtrees/resources/views/setup/step-2-server-checks.phtml (revision 45ebc6c6221f90468111ed2015b8449dca331d93)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6use Illuminate\Support\Collection;
7
8/**
9 * @var int                    $cpu_limit
10 * @var string                 $dbhost
11 * @var string                 $dbname
12 * @var string                 $dbpass
13 * @var string                 $dbport
14 * @var string                 $dbtype
15 * @var string                 $dbuser
16 * @var Collection<int,string> $errors
17 * @var string                 $lang
18 * @var int                    $memory_limit
19 * @var string                 $tblpfx
20 * @var Collection<int,string> $warnings
21 * @var string                 $wtemail
22 * @var string                 $wtname
23 * @var string                 $wtpass
24 * @var string                 $wtuser
25 */
26
27?>
28
29<form method="post" autocomplete="off">
30    <input name="lang" type="hidden" value="<?= e($lang) ?>">
31    <input name="dbtype" type="hidden" value="<?= e($dbtype) ?>">
32    <input name="dbhost" type="hidden" value="<?= e($dbhost) ?>">
33    <input name="dbport" type="hidden" value="<?= e($dbport) ?>">
34    <input name="dbuser" type="hidden" value="<?= e($dbuser) ?>">
35    <input name="dbpass" type="hidden" value="<?= e($dbpass) ?>">
36    <input name="dbname" type="hidden" value="<?= e($dbname) ?>">
37    <input name="tblpfx" type="hidden" value="<?= e($tblpfx) ?>">
38    <input name="wtname" type="hidden" value="<?= e($wtname) ?>">
39    <input name="wtuser" type="hidden" value="<?= e($wtuser) ?>">
40    <input name="wtpass" type="hidden" value="<?= e($wtpass) ?>">
41    <input name="wtemail" type="hidden" value="<?= e($wtemail) ?>">
42
43    <h2>
44        <?= I18N::translate('Checking server configuration') ?>
45    </h2>
46
47    <?php foreach ($errors as $error) : ?>
48        <p class="alert alert-danger"><?= $error ?></p>
49    <?php endforeach ?>
50
51    <?php foreach ($warnings as $warning) : ?>
52        <p class="alert alert-warning"><?= $warning ?></p>
53    <?php endforeach ?>
54
55    <?php if ($errors->isEmpty() && $warnings->isEmpty()) : ?>
56        <p>
57            <?= I18N::translate('The server configuration is OK.') ?>
58        </p>
59    <?php endif ?>
60
61    <h2><?= I18N::translate('Checking server capacity') ?></h2>
62
63    <p>
64        <?= I18N::translate('The memory and CPU time requirements depend on the number of individuals in your family tree.') ?>
65    </p>
66    <p>
67        <?= I18N::translate('The following list shows typical requirements.') ?>
68    </p>
69    <p>
70        <?= I18N::translate('Small systems (500 individuals): 16–32 MB, 10–20 seconds') ?>
71        <br>
72        <?= I18N::translate('Medium systems (5,000 individuals): 32–64 MB, 20–40 seconds') ?>
73        <br>
74        <?= I18N::translate('Large systems (50,000 individuals): 64–128 MB, 40–80 seconds') ?>
75    </p>
76
77    <p class="alert alert-<?= $memory_limit < 32 || $cpu_limit > 0 && $cpu_limit < 20 ? 'danger' : 'success' ?>">
78        <?= I18N::translate('This server’s memory limit is %s MB and its CPU time limit is %s seconds.', I18N::number($memory_limit), I18N::number($cpu_limit)) ?>
79    </p>
80
81    <p>
82        <?= I18N::translate('If you try to exceed these limits, you may experience server time-outs and blank pages.') ?>
83    </p>
84
85    <hr>
86
87    <div class="d-flex justify-content-between">
88        <button class="btn btn-primary" name="step" type="submit" value="3">
89            <?= I18N::translate('next') ?>
90        </button>
91
92        <button class="btn btn-secondary" name="step" type="submit" value="1">
93            <?= I18N::translate('previous') ?>
94        </button>
95    </div>
96</form>
97