summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2011-09-19 13:35:23 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2011-09-19 13:40:07 -0400
commit99fd9d7fe22a8aa81b3f54c2edbcabf95e2526d4 (patch)
tree410d08a28956ef2419c7942b82aeb1536b3ef5e7
parenta352cb965dcb2ad15a823467192113b0f3a34879 (diff)
downloadampache-99fd9d7fe22a8aa81b3f54c2edbcabf95e2526d4.tar.gz
ampache-99fd9d7fe22a8aa81b3f54c2edbcabf95e2526d4.tar.bz2
ampache-99fd9d7fe22a8aa81b3f54c2edbcabf95e2526d4.zip
Make debug and install tests friendlier
"PHP putenv support" had nothing to do with putenv. Split it into multiple tests and have the output actually correspond to what we're checking.
-rw-r--r--lib/debug.lib.php34
-rw-r--r--templates/show_install_check.inc.php24
-rw-r--r--templates/show_test.inc.php24
3 files changed, 53 insertions, 29 deletions
diff --git a/lib/debug.lib.php b/lib/debug.lib.php
index 5bdd6619..bacdd19e 100644
--- a/lib/debug.lib.php
+++ b/lib/debug.lib.php
@@ -240,13 +240,21 @@ function check_php_timelimit() {
} // check_php_timelimit
/**
- * check_putenv
- * This checks to see if we can manually set the
- * memory limit, and other putenvs we need for
- * ampache to work correctly
+ * check_safe_mode
+ * Checks to make sure we aren't in safe mode
*/
-function check_putenv() {
+function check_safemode() {
+ if (ini_get('safe_mode')) {
+ return false;
+ }
+ return true;
+}
+/**
+ * check_override_memory
+ * This checks to see if we can manually override the memory limit
+ */
+function check_override_memory() {
/* Check memory */
$current_memory = ini_get('memory_limit');
$current_memory = substr($current_memory,0,strlen($current_memory)-1);
@@ -264,12 +272,14 @@ function check_putenv() {
return false;
}
- /* Check if safe mode is on */
- if (ini_get('safe_mode')) {
- return false;
- }
+ return true;
+}
- // See if we can override the set_time_limit();
+/**
+ * check_override_exec_time
+ * This checks to see if we can manually override the max execution time
+ */
+function check_override_exec_time() {
$current = ini_get('max_execution_time');
set_time_limit($current+60);
@@ -277,10 +287,8 @@ function check_putenv() {
return false;
}
-
return true;
-
-} // check_putenv
+}
/**
* check_gettext
diff --git a/templates/show_install_check.inc.php b/templates/show_install_check.inc.php
index 42e5e51a..ecb820bc 100644
--- a/templates/show_install_check.inc.php
+++ b/templates/show_install_check.inc.php
@@ -132,19 +132,6 @@
?>
</td>
</tr><tr>
-<td><?php echo _('PHP putenv Support'); ?>:</td>
-<td>
-<?php
- if (!check_putenv()) {
- echo debug_result('',false);
- Error::add('install', _('PHP putenv Support'));
- }
- else {
- echo debug_result('',true);
- }
-?>
-</td>
-</tr><tr>
<th colspan="2"><h4><?php echo _('Optional'); ?></h4></th>
</tr><tr>
<td><?php echo _('PHP gettext Support'); ?>:</td>
@@ -171,6 +158,17 @@
?>
</td>
</tr><tr>
+<td><?php echo _('PHP Safe Mode'); ?>:</td>
+<?php
+ if (!check_safemode()) {
+ echo debug_result(_('Safe mode enabled'), false);
+ }
+ else {
+ echo debug_result(_('Safe mode not enabled'), true);
+ }
+?>
+</td>
+</tr><tr>
<td><?php echo _('PHP Memory Limit'); ?>:</td>
<td>
<?php
diff --git a/templates/show_test.inc.php b/templates/show_test.inc.php
index 480bee7d..fcc070bd 100644
--- a/templates/show_test.inc.php
+++ b/templates/show_test.inc.php
@@ -135,10 +135,10 @@
</td>
</tr>
<tr>
- <td valign="top"><?php echo _('PHP PutENV Support'); ?></td>
+ <td valign="top"><?php echo _('PHP Safe Mode'); ?></td>
<td valign="top">[
<?php
- if (!check_putenv()) {
+ if (!check_safemode()) {
echo debug_result('',false);
}
else {
@@ -147,10 +147,28 @@
?>]
</td>
<td>
- <?php echo _('This test makes sure that PHP isn\'t running in SafeMode and that we are able to modify the memory limits. While not required, without these abilities some features of ampache may not work correctly'); ?>
+ <?php echo _("This test makes sure that PHP isn't running in safe mode. Some features of Ampache may not work correctly in safe mode."); ?>
</td>
</tr>
<tr>
+ <td valign="top"><?php echo _('Override Memory Limit'); ?></td>
+ <td valign="top">[
+ <?php echo debug_result('', check_override_memory()); ?>]
+ </td>
+ <td>
+ <?php echo _('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 _('Override Execution Limit'); ?></td>
+ <td valign="top">[
+ <?php echo debug_result('', check_override_exec_time()); ?>]
+ </td>
+ <td>
+ <?php echo _('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 sprintf(_("%s is readable"),"ampache.cfg.php"); ?></td>
<td valign="top">[
<?php