xref: /webtrees/resources/views/setup/step-4-database-mysql.phtml (revision 83615acfc72bfb50678c6481f2a00bab04041a87)
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="[^`'&quot;]{1,64}" type="text" value="<?= e($dbname) ?>">
91        </div>
92    </div>
93
94    <div class="row form-group">
95        <label class="col-form-label col-sm-3" for="tblpfx">
96            <?= I18N::translate('Table prefix') ?>
97        </label>
98        <div class="col-sm-9">
99            <input class="form-control" dir="ltr" id="tblpfx" maxlength="15" name="tblpfx" pattern="^[^`]*$" type="text" value="<?= e($tblpfx) ?>">
100            <p class="small text-muted">
101                <?= 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.') ?>
102                <?= I18N::translate('Use letters A-Z, a-z, digits 0-9, or underscores') ?>
103            </p>
104        </div>
105    </div>
106
107    <hr>
108
109    <div class="d-flex justify-content-between">
110        <button class="btn btn-primary" name="step" type="submit" value="5">
111            <?= I18N::translate('next') ?>
112        </button>
113
114        <button class="btn btn-secondary" name="step" type="submit" value="3">
115            <?= I18N::translate('previous') ?>
116        </button>
117    </div>
118</form>
119