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