diff options
-rw-r--r-- | templates/show_install_check.inc.php | 153 | ||||
-rw-r--r-- | templates/show_install_lang.inc.php | 7 | ||||
-rw-r--r-- | templates/show_test.inc.php | 195 | ||||
-rw-r--r-- | templates/show_test_table.inc.php | 222 |
4 files changed, 245 insertions, 332 deletions
diff --git a/templates/show_install_check.inc.php b/templates/show_install_check.inc.php index 6b6e7247..5b6fd83d 100644 --- a/templates/show_install_check.inc.php +++ b/templates/show_install_check.inc.php @@ -21,162 +21,49 @@ */ ?> <?php if (!defined('INSTALL')) { exit; } ?> -<h4><?php echo T_('Required'); ?></h4> + <table border="0" cellspacing="0" cellpadding="3"> <tr> -<td><?php echo sprintf(T_("%s is readable"),"ampache.cfg.php.dist"); ?></td> -<td> + <td><font size="+1"><?php echo T_('CHECK'); ?></font></td> + <td> + <font size="+1"><?php echo T_('STATUS'); ?></font> + </td> + <td><font size="+1"><?php echo T_('DESCRIPTION'); ?></font></td> +</tr> +<?php require $prefix . '/templates/show_test_table.inc.php'; ?> +<tr> +<td><?php echo sprintf(T_('%s is readable'), 'ampache.cfg.php.dist'); ?></td> +<td>[ <?php if (!is_readable($prefix . '/config/ampache.cfg.php.dist')) { - echo debug_result('',false); - Error::add('install',sprintf(T_("%s is readable"),"ampache.cfg.php.dist")); + echo debug_result('', false); } else { - echo debug_result('',true); + echo debug_result('', true); } ?> +] </td> +<td><?php echo T_('This tests whether the configuration template can be read.'); ?></td> </tr> <tr> <td><?php echo sprintf(T_('%s is readable'), 'ampache.sql'); ?></td> -<td> +<td>[ <?php if (!is_readable($prefix . '/sql/ampache.sql')) { echo debug_result('', false); - Error::add('install', sprintf(T_('%s is readable'), 'ampache.sql')); } else { echo debug_result('', true); } ?> +] </td> +<td><?php echo T_('This tests whether the file needed to initialise the database structure is available.'); ?></td> </tr> <tr> -<td><?php echo T_('PHP Version'); ?>:</td> -<td> -<?php - if(!check_php_ver()) { - if (function_exists('hash_algos')) { $algos = hash_algos(); } - if (strtoupper(substr(PHP_OS,0,3)) == 'WIN') { - $version_string = phpversion() . " < PHP 5.3 "; - } - else { - $version_string = phpversion() . " "; - } - $string = $version_string . T_('Hash Function Exists') . " " . print_bool(function_exists('hash_algos')) . " " . T_('SHA256 Support') . " " . print_bool(in_array('sha256',$algos)); - echo debug_result($string,false); - Error::add('install', T_('PHP Version')); - } - else { - echo debug_result(phpversion(),true); - } -?> -</td> -</tr><tr> -<td><?php echo T_('PHP Session Support'); ?>:</td> -<td> -<?php - if (!check_php_session()) { - echo debug_result('',false); - Error::add('install', T_('PHP Session Support')); - } - else { - echo debug_result('',true); - } -?> -</td> -</tr><tr> -<td><?php echo T_('PHP iconv Support'); ?>:</td> -<td> -<?php - if (!UI::check_iconv()) { - echo debug_result('',false); - Error::add('install', T_('PHP iconv Support')); - } - else { - echo debug_result('',true); - } -?> -</td> -</tr><tr> -<td><?php echo T_('PHP PCRE Support'); ?>:</td> -<td> -<?php - if (!check_php_pcre()) { - echo debug_result('',false); - Error::add('install', T_('PHP PCRE Support')); - } - else { - echo debug_result('',true); - } -?> -</td> -</tr><tr> -<th colspan="2"><h4><?php echo T_('Optional'); ?></h4></th> -</tr><tr> -<td><?php echo T_('PHP gettext Support'); ?>:</td> -<td> -<?php - if (!check_gettext()) { - echo debug_result(T_('gettext emulation will be used'), false); - } - else { - echo debug_result('',true); - } -?> -</td> -</tr><tr> -<td><?php echo T_('PHP mbstring Support'); ?>:</td> -<td> -<?php - if (!check_mbstring()) { - echo debug_result(T_('Multibyte character encodings may not be autodetected correctly'), false); - } - else { - echo debug_result('',true); - } -?> -</td> -</tr><tr> -<td><?php echo T_('PHP Safe Mode'); ?>:</td> -<td> -<?php - if (!check_safemode()) { - echo debug_result(T_('Safe mode enabled'), false); - } - else { - echo debug_result(T_('Safe mode not enabled'), true); - } -?> -</td> -</tr><tr> -<td><?php echo T_('PHP Memory Limit'); ?>:</td> -<td> -<?php - if (!check_php_memory()) { - echo debug_result(T_('Memory limit less than recommended size') . ' ' . ini_get('memory_limit'), false); - } - else { - echo debug_result(ini_get('memory_limit'),true); - } - -?> -</td> -</tr><tr> -<td><?php echo T_('PHP Execution Time Limit'); ?>:</td> -<td> -<?php - if (!check_php_timelimit()) { - echo debug_result(sprintf(T_('Execution time limit is %s seconds, which is less than recommended'), ini_get('max_execution_time')), false); - } - else { - echo debug_result(ini_get('max_execution_time') . ' ' . T_('seconds'),true); - } -?> -</td> -</tr><tr> <td><?php echo T_('ampache.cfg.php is writable'); ?></td> -<td> +<td>[ <?php if (!check_config_writable()) { echo debug_result('', false); @@ -185,6 +72,8 @@ echo debug_result('', true); } ?> +] </td> +<td><?php echo T_('This tests whether PHP can write to config/. This is not strictly necessary, but will help streamline the installation process.'); ?></td> </tr> </table> diff --git a/templates/show_install_lang.inc.php b/templates/show_install_lang.inc.php index 63e3290e..8fa5240b 100644 --- a/templates/show_install_lang.inc.php +++ b/templates/show_install_lang.inc.php @@ -23,12 +23,7 @@ $prefix = realpath(dirname(__FILE__). "/../"); require $prefix . '/templates/install_header.inc.php'; ?> -<?php require_once 'templates/show_install_check.inc.php'; ?> -<?php if (Error::occurred()) { ?> - <div class="content"> - <span class="fatalerror"><?php echo T_('Minimum requirements not met. Unable to install Ampache.'); ?></span> - </div> -<?php } ?> +<?php require_once $prefix . '/templates/show_install_check.inc.php'; ?> <div class="content"> <strong><?php echo T_('Choose Installation Language'); ?></strong> diff --git a/templates/show_test.inc.php b/templates/show_test.inc.php index 6a2b2b2b..c517766a 100644 --- a/templates/show_test.inc.php +++ b/templates/show_test.inc.php @@ -41,200 +41,7 @@ </td> <td><font size="+1"><?php echo T_('DESCRIPTION'); ?></font></td> </tr> -<tr> - <td valign="top"><?php echo T_('PHP version'); ?></td> - <td valign="top">[ - <?php - if (!check_php_ver()) { - echo debug_result('',false); - if (function_exists('hash_algos')) { $algos = hash_algos(); } - $string = "<strong>" . phpversion() . " " . T_('Hash Function Exists') . " " . print_bool(function_exists('hash_algos')) . " " . T_('SHA256 Support') . " " . print_bool(in_array('sha256',$algos)) . "</strong>"; - } - else { - echo debug_result('',true); - } - ?> - ] - </td> - <td> - <?php echo T_('This tests whether you are running at least the minimum version of PHP required by Ampache.'); ?> - <?php echo $string; ?> - </td> -</tr> -<tr> - <td valign="top"><?php echo T_('PHP PDO'); ?></td> - <td valign="top">[ - <?php echo debug_result('', check_pdo()); ?> - ] - </td> - <td> - <?php echo T_('This tests whether the PDO extension and the MySQL driver for PDO are installed. These are required by Ampache.'); ?> - </td> -</tr> -<tr> - <td valign="top"><?php echo T_('PHP session extension'); ?></td> - <td valign="top">[ - <?php - if (!check_php_session()) { - echo debug_result('',false); - } - else { - echo debug_result('',true); - } - ?> - ] - </td> - <td> - <?php echo T_('This tests whether you have the session extension enabled. This extension is required by Ampache.'); ?> - </td> -</tr> -<tr> - <td valign="top"><?php echo T_('PHP iconv extension'); ?></td> - <td valign="top">[ - <?php - if (!UI::check_iconv()) { - echo debug_result('',false); - } - else { - echo debug_result('',true); - } - ?>] - </td> - <td> - <?php echo T_('This tests whether you have the iconv extension enabled. This extension is required by Ampache.'); ?> - </td> -</tr> -<tr> - <td valign="top"><?php echo T_('PHP safe mode disabled'); ?></td> - <td valign="top">[ - <?php - if (!check_safemode()) { - echo debug_result('',false); - } - else { - echo debug_result('',true); - } - ?>] - </td> - <td> - <?php echo T_('This test makes sure that PHP is not running in safe mode. Some features of Ampache will not work correctly in safe mode.'); ?> - </td> -</tr> -<tr> - <td valign="top"><?php echo T_('PHP memory limit override'); ?></td> - <td valign="top">[ - <?php echo debug_result('', check_override_memory()); ?>] - </td> - <td> - <?php echo T_('This tests whether Ampache can override the memory limit. This is not strictly necessary, but may result in a better experience.'); ?> - </td> -</tr> -<tr> - <td valign="top"><?php echo T_('PHP execution time override'); ?></td> - <td valign="top">[ - <?php echo debug_result('', check_override_exec_time()); ?>] - </td> - <td> - <?php echo T_('This tests whether Ampache can override the limit on maximum execution time. This is not strictly necessary, but may result in a better experience.'); ?> - </td> -</tr> -<tr> - <td valign="top"><?php echo T_('Configuration file readability'); ?></td> - <td valign="top">[ - <?php - if (!is_readable($configfile)) { - echo debug_result('',false); - } - else { - echo debug_result('',true); - } - ?> - ] - </td> - <td width="350px"> - <?php echo T_('This test attempts to read config/ampache.cfg.php. If this fails the file either is not in the correct location or is not currently readable.'); ?> - </td> -</tr> -<tr> - <td valign="top"> - <?php echo T_('Configuration file validity'); ?> - </td> - <td valign="top">[ - <?php - $results = @parse_ini_file($configfile); - Config::set_by_array($results); - if (!check_config_values($results)) { - echo debug_result('',false); - } - else { - echo debug_result('',true); - } - ?> - ] - </td> - <td> - <?php echo T_("This test makes sure that you have set all of the required configuration variables and that we are able to completely parse your config file."); ?> - </td> -</tr> -<tr> - <td valign="top"><?php echo T_("Database connection"); ?></td> - <td valign="top">[ - <?php - if (!check_pdo() || !Dba::check_database()) { - echo debug_result('',false); - } - else { - echo debug_result('',true); - } - ?> - ] - </td> - <td> - <?php echo T_('This attempts to connect to your database using the values read from your configuration file.'); ?> - </td> -</tr> -<tr> - <td valign="top"><?php echo T_('Database tables'); ?></td> - <td valign="top">[ - <?php - $db_inserted = check_pdo() ? Dba::check_database_inserted() : false; - if (!$db_inserted) { - echo debug_result('',false); - } - else { - echo debug_result('',true); - } - ?> - ] - </td> - <td> - <?php echo T_('This checks a few key tables to make sure that you have successfully inserted the Ampache database and that the user has access to the database'); ?> - </td> -</tr> -<tr> - - <td valign="top"><?php echo T_('Web path'); ?></td> - <td valign="top">[ - <?php - if ($results['force_ssl']) { - $http_type = 'https://'; - } - - $results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . Config::get('web_path'); - if (check_config_values($results)) { - echo " <img src=\"" . $results['web_path'] ."/images/icon_enable.png\" /> "; - } - else { - echo debug_result('',false); - } - - ?> - ] - </td> - <td> - <?php echo T_('This test makes sure that your web_path variable is set correctly and that we are able to get to the index page. If you do not see a check mark here then your web_path is not set correctly.'); ?> - </td> -</tr> +<?php require $prefix . '/templates/show_test_table.inc.php'; ?> </table> </div> <div id="bottom"> diff --git a/templates/show_test_table.inc.php b/templates/show_test_table.inc.php new file mode 100644 index 00000000..6bcc5b03 --- /dev/null +++ b/templates/show_test_table.inc.php @@ -0,0 +1,222 @@ +<?php +/* vim:set softtabstop=4 shiftwidth=4 expandtab: */ +/** + * + * LICENSE: GNU General Public License, version 2 (GPLv2) + * Copyright 2001 - 2013 Ampache.org + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License v2 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ +?> +<tr> + <td valign="top"><?php echo T_('PHP version'); ?></td> + <td valign="top">[ + <?php + if (!check_php_ver()) { + echo debug_result('',false); + if (function_exists('hash_algos')) { $algos = hash_algos(); } + $string = "<strong>" . phpversion() . " " . T_('Hash Function Exists') . " " . print_bool(function_exists('hash_algos')) . " " . T_('SHA256 Support') . " " . print_bool(in_array('sha256',$algos)) . "</strong>"; + } + else { + echo debug_result('',true); + } + ?> + ] + </td> + <td> + <?php echo T_('This tests whether you are running at least the minimum version of PHP required by Ampache.'); ?> + <?php echo $string; ?> + </td> +</tr> +<tr> + <td valign="top"><?php echo T_('PHP PDO'); ?></td> + <td valign="top">[ + <?php echo debug_result('', check_pdo()); ?> + ] + </td> + <td> + <?php echo T_('This tests whether the PDO extension and the MySQL driver for PDO are installed. These are required by Ampache.'); ?> + </td> +</tr> +<tr> + <td valign="top"><?php echo T_('PHP session extension'); ?></td> + <td valign="top">[ + <?php + if (!check_php_session()) { + echo debug_result('',false); + } + else { + echo debug_result('',true); + } + ?> + ] + </td> + <td> + <?php echo T_('This tests whether you have the session extension enabled. This extension is required by Ampache.'); ?> + </td> +</tr> +<tr> + <td valign="top"><?php echo T_('PHP iconv extension'); ?></td> + <td valign="top">[ + <?php + if (!UI::check_iconv()) { + echo debug_result('',false); + } + else { + echo debug_result('',true); + } + ?>] + </td> + <td> + <?php echo T_('This tests whether you have the iconv extension enabled. This extension is required by Ampache.'); ?> + </td> +</tr> +<tr> + <td valign="top"><?php echo T_('PHP safe mode disabled'); ?></td> + <td valign="top">[ + <?php + if (!check_safemode()) { + echo debug_result('',false); + } + else { + echo debug_result('',true); + } + ?>] + </td> + <td> + <?php echo T_('This test makes sure that PHP is not running in safe mode. Some features of Ampache will not work correctly in safe mode.'); ?> + </td> +</tr> +<tr> + <td valign="top"><?php echo T_('PHP memory limit override'); ?></td> + <td valign="top">[ + <?php echo debug_result('', check_override_memory()); ?>] + </td> + <td> + <?php echo T_('This tests whether Ampache can override the memory limit. This is not strictly necessary, but may result in a better experience.'); ?> + </td> +</tr> +<tr> + <td valign="top"><?php echo T_('PHP execution time override'); ?></td> + <td valign="top">[ + <?php echo debug_result('', check_override_exec_time()); ?>] + </td> + <td> + <?php echo T_('This tests whether Ampache can override the limit on maximum execution time. This is not strictly necessary, but may result in a better experience.'); ?> + </td> +</tr> +<?php +if (!defined('INSTALL')) { +?> +<tr> + <td valign="top"><?php echo T_('Configuration file readability'); ?></td> + <td valign="top">[ + <?php + if (!is_readable($configfile)) { + echo debug_result('',false); + } + else { + echo debug_result('',true); + } + ?> + ] + </td> + <td width="350px"> + <?php echo T_('This test attempts to read config/ampache.cfg.php. If this fails the file either is not in the correct location or is not currently readable.'); ?> + </td> +</tr> +<tr> + <td valign="top"> + <?php echo T_('Configuration file validity'); ?> + </td> + <td valign="top">[ + <?php + $results = @parse_ini_file($configfile); + Config::set_by_array($results); + if (!check_config_values($results)) { + echo debug_result('',false); + } + else { + echo debug_result('',true); + } + ?> + ] + </td> + <td> + <?php echo T_("This test makes sure that you have set all of the required configuration variables and that we are able to completely parse your config file."); ?> + </td> +</tr> +<tr> + <td valign="top"><?php echo T_("Database connection"); ?></td> + <td valign="top">[ + <?php + if (!check_pdo() || !Dba::check_database()) { + echo debug_result('',false); + } + else { + echo debug_result('',true); + } + ?> + ] + </td> + <td> + <?php echo T_('This attempts to connect to your database using the values read from your configuration file.'); ?> + </td> +</tr> +<tr> + <td valign="top"><?php echo T_('Database tables'); ?></td> + <td valign="top">[ + <?php + $db_inserted = check_pdo() ? Dba::check_database_inserted() : false; + if (!$db_inserted) { + echo debug_result('',false); + } + else { + echo debug_result('',true); + } + ?> + ] + </td> + <td> + <?php echo T_('This checks a few key tables to make sure that you have successfully inserted the Ampache database and that the user has access to the database'); ?> + </td> +</tr> +<tr> + + <td valign="top"><?php echo T_('Web path'); ?></td> + <td valign="top">[ + <?php + if ($results['force_ssl']) { + $http_type = 'https://'; + } + + $results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . Config::get('web_path'); + if (check_config_values($results)) { + echo " <img src=\"" . $results['web_path'] ."/images/icon_enable.png\" /> "; + } + else { + echo debug_result('',false); + } + + ?> + ] + </td> + <td> + <?php echo T_('This test makes sure that your web_path variable is set correctly and that we are able to get to the index page. If you do not see a check mark here then your web_path is not set correctly.'); ?> + </td> +</tr> +<?php +} +?> |