Commit 4723bd2fa6f35bc8b8d6ee7e331c2339de567da4

Authored by Neil Blakey-Milner
1 parent 4eaf340f

Make sensible values for some variables (like 0 or -1 meaning

"unlimited") not show errors.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5641 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 7 additions and 3 deletions
setup/precheckup.php
... ... @@ -124,7 +124,7 @@ function get_php_int_setting($val) {
124 124 return prettySizeToActualSize($r);
125 125 }
126 126  
127   -function bigEnough($name, $setting, $preferred, $bytes = false, $red = true) {
  127 +function bigEnough($name, $setting, $preferred, $bytes = false, $red = true, $zero_ok = false, $minusone_ok = false) {
128 128 $current = get_php_int_setting($setting);
129 129 if ($bytes === true) {
130 130 $ret = sprintf('<tr><td>%s (%s)</td><td>%s</td><td>', $name, $setting, prettySize($preferred));
... ... @@ -140,6 +140,10 @@ function bigEnough($name, $setting, $preferred, $bytes = false, $red = true) {
140 140 } else {
141 141 $ret .= sprintf('<font color="green"><b>%s</b></font>', $current);
142 142 }
  143 + } else if (($current == 0) && ($zero_ok)) {
  144 + $ret .= sprintf('<font color="green"><b>unlimited (%s)</b></font>', $current);
  145 + } else if (($current == -1) && ($minusone_ok)) {
  146 + $ret .= sprintf('<font color="green"><b>unlimited (%s)</b></font>', $current);
143 147 } else {
144 148 if ($bytes === true) {
145 149 $ret .= sprintf('<font color="red"><b>%s</b></font>', prettySize($current));
... ... @@ -335,8 +339,8 @@ PHP you are running, and which modules are available.&lt;/p&gt;
335 339 </thead>
336 340 <tbody>
337 341 <?php echo bigEnough('Maximum POST size', 'post_max_size', 32 * 1024 * 1024, true)?>
338   -<?php echo bigEnough('Maximum upload size', 'upload_max_filesize', 32 * 1024 * 1024, true)?>
339   -<?php echo bigEnough('Memory limit', 'memory_limit', 32 * 1024 * 1024, true)?>
  342 +<?php echo bigEnough('Maximum upload size', 'upload_max_filesize', 32 * 1024 * 1024, true, true, false, true)?>
  343 +<?php echo bigEnough('Memory limit', 'memory_limit', 32 * 1024 * 1024, true, true, false, true)?>
340 344 <?php echo ""; # bigEnough('Maximum execution time', 'max_execution_time', 30)?>
341 345 <?php echo ""; # bigEnough('Maximum input time', 'max_input_time', 60)?>
342 346 <tbody>
... ...