xref: /webtrees/resources/views/setup/step-4-database-mysql.phtml (revision b11cdcd45131b1585d66693fab363cfeb18c51a4)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6use Illuminate\Support\Collection;
7
8/**
9 * @var string                 $dbhost
10 * @var string                 $dbname
11 * @var string                 $dbpass
12 * @var string                 $dbport
13 * @var string                 $dbtype
14 * @var string                 $dbuser
15 * @var Collection<int,string> $errors
16 * @var string                 $lang
17 * @var string                 $tblpfx
18 * @var Collection<int,string> $warnings
19 * @var string                 $wtemail
20 * @var string                 $wtname
21 * @var string                 $wtpass
22 * @var string                 $wtuser
23 */
24
25?>
26
27<form method="post" autocomplete="off">
28    <input name="lang" type="hidden" value="<?= e($lang) ?>">
29    <input name="dbtype" type="hidden" value="<?= e($dbtype) ?>">
30    <input name="wtname" type="hidden" value="<?= e($wtname) ?>">
31    <input name="wtuser" type="hidden" value="<?= e($wtuser) ?>">
32    <input name="wtpass" type="hidden" value="<?= e($wtpass) ?>">
33    <input name="wtemail" type="hidden" value="<?= e($wtemail) ?>">
34
35    <h2>
36        <?= I18N::translate('Database connection') ?> – MySQL / MariaDB / Percona
37    </h2>
38
39    <?php foreach ($errors as $error) : ?>
40        <p class="alert alert-danger"><?= $error ?></p>
41    <?php endforeach ?>
42
43    <?php foreach ($warnings as $warning) : ?>
44        <p class="alert alert-warning"><?= $warning ?></p>
45    <?php endforeach ?>
46
47    <div class="row mb-3">
48        <label class="col-form-label col-sm-3" for="dbhost">
49            <?= I18N::translate('Server name') ?>
50        </label>
51
52        <div class="col-sm-9">
53            <input class="form-control" id="dbhost" name="dbhost" type="text" value="<?= e($dbhost) ?>" dir="ltr">
54
55            <div class="form-text">
56                <?= I18N::translate('Most sites are configured to use localhost. This means that your database runs on the same computer as your web server.') ?>
57            </div>
58
59            <!--
60            <div class="form-text">
61                <?= I18N::translate('If you connect to the database using a UNIX socket, enter the path here and leave the port number empty.') ?>
62            </div>
63            -->
64        </div>
65    </div>
66
67    <div class="row mb-3">
68        <label class="col-form-label col-sm-3" for="dbport">
69            <?= I18N::translate('Port number') ?>
70        </label>
71
72        <div class="col-sm-9">
73            <input class="form-control" id="dbport" name="dbport" pattern="\d+" type="text" value="<?= e($dbport) ?>" dir="ltr">
74
75            <div class="form-text">
76                <?= I18N::translate('Most sites are configured to use the default value of 3306.') ?>
77            </div>
78        </div>
79    </div>
80
81    <div class="row mb-3">
82        <label class="col-form-label col-sm-3" for="dbuser">
83            <?= I18N::translate('Database user account') ?>
84        </label>
85
86        <div class="col-sm-9">
87            <input class="form-control" id="dbuser" name="dbuser" type="text" value="<?= e($dbuser) ?>" dir="ltr">
88
89            <div class="form-text">
90                <?= I18N::translate('This is case sensitive.') ?>
91            </div>
92        </div>
93    </div>
94
95    <div class="row mb-3">
96        <label class="col-form-label col-sm-3" for="dbpass">
97            <?= I18N::translate('Database password') ?>
98        </label>
99
100        <div class="col-sm-9">
101            <input class="form-control" id="dbpass" name="dbpass" type="password" value="<?= e($dbpass) ?>" dir="ltr" autocomplete="off" data-wt-show-password-text="<?= e(I18N::translate('show')) ?>" data-wt-show-password-title="<?= e(I18N::translate('Show password')) ?>" data-wt-hide-password-text="<?= e(I18N::translate('hide')) ?>" data-wt-hide-password-title="<?= e(I18N::translate('Hide password')) ?>">
102
103            <div class="form-text">
104                <?= I18N::translate('This is case sensitive.') ?>
105            </div>
106        </div>
107    </div>
108
109    <div class="row mb-3">
110        <label class="col-form-label col-sm-3" for="dbname">
111            <?= I18N::translate('Database name') ?>
112        </label>
113
114        <div class="col-sm-9">
115            <input class="form-control" dir="ltr" id="dbname" name="dbname" pattern="[^`'&quot;]{1,64}" type="text" value="<?= e($dbname) ?>">
116        </div>
117    </div>
118
119    <div class="row mb-3">
120        <label class="col-form-label col-sm-3" for="tblpfx">
121            <?= I18N::translate('Table prefix') ?>
122        </label>
123        <div class="col-sm-9">
124            <input class="form-control" dir="ltr" id="tblpfx" maxlength="15"  name="tblpfx" pattern="[a-zA-Z0-9_]+" type="text" value="<?= e($tblpfx) ?>">
125            <div class="form-text">
126                <?= I18N::translate('The prefix is optional, but recommended. By giving the table names a unique prefix you can let several different applications share the same database.') ?>
127                <?= I18N::translate('Use letters A-Z, a-z, digits 0-9, or underscores') ?>
128            </div>
129        </div>
130    </div>
131
132    <hr>
133
134    <div class="d-flex justify-content-between">
135        <button class="btn btn-primary" name="step" type="submit" value="5">
136            <?= I18N::translate('next') ?>
137        </button>
138
139        <button class="btn btn-secondary" name="step" type="submit" value="3">
140            <?= I18N::translate('previous') ?>
141        </button>
142    </div>
143</form>
144