]>
git.agnieray.net Git - galette.git/blob - galette/install/steps/check.php
63a52de83a85b7b2dec6d1b697aeb1b4697d8524
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
6 * Galette installation, check step
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
34 * @link http://galette.tuxfamily.org
35 * @since Available since 0.8 - 2013-01-09
38 < h2
>< ?php
echo _T ( "Welcome to the Galette Install!" ); ?
></ h2
>
42 $php_modules_class = '' ;
43 $files_perms_class = '' ;
45 // check required PHP version...
46 if ( version_compare ( PHP_VERSION
, GALETTE_PHP_MIN
, '<' )) {
50 // check date settings
52 if (! version_compare ( PHP_VERSION
, '5.2.0' , '<' )) {
54 $test_date = new DateTime ();
56 } catch ( Exception
$e ) {
62 $cm = new Galette\Core\
CheckModules ();
63 $modules_ok = $cm -> isValid ();
65 // check file permissions
67 $files_need_rw = array (
68 _T ( "Compilation" ) => GALETTE_COMPILE_DIR
,
69 _T ( "Photos" ) => GALETTE_PHOTOS_PATH
,
70 _T ( "Cache" ) => GALETTE_CACHE_DIR
,
71 _T ( "Temporary images" ) => GALETTE_TEMPIMAGES_PATH
,
72 _T ( "Configuration" ) => GALETTE_CONFIG_PATH
,
73 _T ( "Exports" ) => GALETTE_EXPORTS_PATH
,
74 _T ( "Imports" ) => GALETTE_IMPORTS_PATH
,
75 _T ( "Logs" ) => GALETTE_LOGS_PATH
,
76 _T ( "Attachments" ) => GALETTE_ATTACHMENTS_PATH
,
77 _T ( "Files" ) => GALETTE_FILES_PATH
80 $files_perms_class = $class . 'ok' ;
82 foreach ( $files_need_rw as $label => $file ) {
83 $writable = is_writable ( $file );
89 if ( $perms_ok && $modules_ok && $php_ok && $date_ok ) {
90 echo '<p id="infobox">' . _T ( "Galette requirements are met :)" ) . '</p>' ;
94 echo '<p class="error">' . _T ( "Your PHP date settings are not correct. Maybe you've missed the timezone settings that is mandatory since PHP 5.3?" ) . '</p>' ;
99 < span
>< ?php
echo _T ( "PHP version" ); ?
> (< ?php
echo PHP_VERSION
. ' >= ' . GALETTE_PHP_MIN
; ?
>)</ span
>
100 < span
>< ?php
echo $install -> getValidationImage ( $php_ok == true ); ?
></ span
>
103 < span
>< ?php
echo _T ( "Date settings" ); ?
></ span
>
104 < span
>< ?php
echo $install -> getValidationImage ( $date_ok == true ); ?
></ span
>
108 < h3
>< ?php
echo _T ( "PHP Modules" ); ?
></ h3
>
111 echo '<p class="error">' . _T ( "Some PHP modules are missing. Please install them or contact your support.<br/>More information on required modules may be found in the documentation." ) . '</p>' ;
115 < ?php
echo $cm -> toHtml (); ?
>
118 < h3
>< ?php
echo _T ( "Files permissions" ); ?
></ h3
>
121 foreach ( $files_need_rw as $label => $file ) {
122 $writable = is_writable ( $file );
125 < span
>< ?php
echo $label ?
></ span
>
126 < span
>< ?php
echo $install -> getValidationImage ( is_writable ( $file )); ?
></ span
>
135 < article id
= "files_perms" class = "<?php echo $files_perms_class ; ?>" >
137 < h4
class = "error" >< ?php
echo _T ( "Files permissions are not OK!" ); ?
></ h4
>
139 if ( $install -> isInstall ()) {
140 echo _T ( "To work as excpected, Galette needs write permission on files listed above." );
141 } else if ( $install -> isUpgrade ()) {
142 echo _T ( "In order to be updated, Galette needs write permission on files listed above." );
145 < p
>< ?php
echo _T ( "Under UNIX/Linux, you can give the permissions using those commands" ); ?
>< br
/>
146 < code
> chown
< em
>< ?php
echo _T ( "apache_user" ); ?
></ em
> < em
>< ?php
echo _T ( "file_name" ); ?
></ em
>< br
/> chmod
700 < em
>< ?php
echo _T ( "directory_name" ); ?
></ em
></ code
>
148 < p
>< ?php
echo _T ( "Under Windows, check these directories are not in Read-Only mode in their property panel." ); ?
></ p
>
154 if (! $perms_ok ||
! $modules_ok ||
! $php_ok ||
! $date_ok ) {
156 < form action
= "installer.php" method
= "post" >
158 < input type
= "submit" id
= "retry_btn" value
= "<?php echo _T(" Retry
"); ?>" />
164 < form action
= "installer.php" method
= "POST" >
166 < input id
= "next_btn" type
= "submit" value
= "<?php echo _T(" Next step
"); ?>" />
167 < input type
= "hidden" name
= "install_permsok" value
= "1" />