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