install/includes/stages/sysreqs.php
changeset 857 f3a5a276208c
parent 852 e1ce6a91469b
child 932 d5437edb6c1c
--- a/install/includes/stages/sysreqs.php	Fri Mar 06 11:19:55 2009 -0500
+++ b/install/includes/stages/sysreqs.php	Sat Mar 14 14:06:02 2009 -0400
@@ -48,55 +48,6 @@
   return $r;
 }
 
-function write_test($filename)
-{
-  // We need to actually _open_ the file to make sure it can be written, because sometimes this fails even when is_writable() returns
-  // true on Windows/IIS servers. Don't ask me why.
-  
-  $file = ENANO_ROOT . '/' . $filename;
-  if ( is_dir($file) )
-  {
-    $file = rtrim($file, '/') . '/' . 'enanoinstalltest.txt';
-    if ( file_exists($file) )
-    {
-      $fp = @fopen($file, 'a+');
-      if ( !$fp )
-        return false;
-      fclose($fp);
-      unlink($file);
-      return true;
-    }
-    else
-    {
-      $fp = @fopen($file, 'w');
-      if ( !$fp )
-        return false;
-      fclose($fp);
-      unlink($file);
-      return true;
-    }
-  }
-  else
-  {
-    if ( file_exists($file) )
-    {
-      $fp = @fopen($file, 'a+');
-      if ( !$fp )
-        return false;
-      fclose($fp);
-      return true;
-    }
-    else
-    {
-      $fp = @fopen($file, 'w');
-      if ( !$fp )
-        return false;
-      fclose($fp);
-      return true;
-    }
-  }
-}
-
 $warnings = array();
 $failed = false;
 $have_dbms = false;
@@ -120,6 +71,7 @@
   $req_php = 'bad';
 }
 
+// Test: Safe Mode
 $req_safemode = !intval(@ini_get('safe_mode'));
 if ( !$req_safemode )
 {
@@ -143,6 +95,11 @@
 // Test: File uploads
 $req_uploads = intval(@ini_get('file_uploads'));
 
+// Test: ctype validation
+$req_ctype = function_exists('ctype_digit');
+if ( !$req_ctype )
+  $failed = true;
+
 // Writability test: config
 $req_config_w = write_test('config.new.php');
 
@@ -242,24 +199,6 @@
  
 <table border="0" cellspacing="0" cellpadding="0" class="sysreqs">
 
-<?php
-/*
-  
-  </div>
-<?php
-}
-else
-{
-  if ( $failed )
-  {
-    echo '<div class="pagenav"><table border="0" cellspacing="0" cellpadding="0">';
-    run_test('return false;', $lang->get('sysreqs_summary_fail_title'), $lang->get('sysreqs_summary_fail_body'));
-    echo '</table></div>';
-  }
-}
-*/
-?>
-
 <tr>
   <th colspan="2"><?php echo $lang->get('sysreqs_heading_serverenv'); ?></th>
 </tr>
@@ -303,6 +242,17 @@
 </tr>
 
 <tr>
+  <td><?php echo $lang->get('sysreqs_req_ctype'); ?></td>
+  <?php
+  if ( $req_ctype ):
+    echo '<td class="good">' . $lang->get('sysreqs_req_supported') . '</td>';
+  else:
+    echo '<td class="bad">' . $lang->get('sysreqs_req_unsupported') . '</td>';
+  endif;
+  ?>
+</tr>
+
+<tr>
   <th colspan="2"><?php echo $lang->get('sysreqs_heading_dbms'); ?></th>
 </tr>