]>
git.agnieray.net Git - galette.git/blob - galette/install/steps/db_install.php
4aed8d1e55a78b6a32fb83b4ef4d3aaa26369dfe
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
6 * Galette installation, database initialization/upgrade
10 * Copyright © 2013-2014 The Galette Team
12 * This file is part of Galette (http://galette.tuxfamily.org).
14 * Galette is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
19 * Galette is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2013-2014 The Galette Team
32 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
33 * @link http://galette.tuxfamily.org
34 * @since Available since 0.8 - 2013-01-12
37 use Galette\Core\Install
as GaletteInstall
;
38 use Galette\Core\Db
as GaletteDb
;
40 //ok, let's run the scripts!
41 $db_installed = $install->executeScripts($zdb);
43 if ($db_installed === false) {
44 $msg = _T("Database has not been installed!");
45 if ($install->isUpgrade()) {
46 $msg = _T("Database has not been upgraded!");
48 echo '<p class="ui red message">' . $msg . '</p>';
50 $msg = _T("Database has been installed :)");
51 if ($install->isUpgrade()) {
52 $msg = _T("Database has been upgraded :)");
54 echo '<p class="ui green message">' . $msg . '</p>';
59 foreach ($install->getDbInstallReport() as $r) {
62 <span
><?php
echo $r['message']; ?
></span
>
63 <span
><?php
echo $install->getValidationImage($r['res']); ?
></span
>
70 <div
class="ui section divider"></div
>
72 <form action
="installer.php" method
="POST" class="ui form">
73 <div
class="ui mobile reversed tablet reversed computer reversed equal width grid">
74 <div
class="right aligned column">
78 <button type
="submit" class="ui right labeled icon button"><i
class="redo alternate double right icon"></i
> <?php
echo _T("Retry"); ?
></button
>
82 <button type
="submit" class="ui right labeled icon button"<?php
if (!$db_installed) { echo ' disabled="disabled"'; } ?
>><i
class="angle double right icon"></i
> <?php
echo _T("Next step"); ?
></button
>
86 <input type
="hidden" name
="install_dbwrite_ok" value
="1"/>
93 //once DB is installed, that does not make sense to go back
96 <button type
="submit" id
="btnback" name
="stepback_btn" formnovalidate
class="ui labeled icon button"><i
class="angle double left icon"></i
> <?php
echo _T("Back"); ?
></button
>