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