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