phpUserTrack
[ class tree: phpUserTrack ] [ index: phpUserTrack ] [ all elements ]

Source for file test.php

Documentation is available at test.php

  1. <?php
  2.  
  3. //error_reporting(0);
  4.  
  5. /* Register a session. */
  6. ini_set('register_long_arrays','1');
  7.  
  8. $passTests true;
  9.  
  10. /* Initialize the phpUserTrack_Test:: class. */
  11. if (!include_once './lib/libTest.php'{
  12.     /* Try and provide enough information to debug the missing file. */
  13.     echo '<br /><span class="notsupported">Unable to find phpUserTrack/lib/libTest.php. ' .
  14.     'Your phpUserTrack installation may be missing critical files, or PHP may not ' .
  15.     'have sufficient permissions to include files. There may be error messages printed ' .
  16.     'above this message that will help you in debugging the problem.</span>';
  17.     exit;
  18. }
  19.  
  20. /* If we've gotten this far, we should have found enough of phpUserTrack to run
  21.  * tests. Create the testing object. */
  22. $phpUserTrack_test new phpUserTrack_Test();
  23.  
  24. /* phpUserTrack definitions. */
  25. $module 'phpUserTrack';
  26. require_once './include/version.php';
  27. $module_version PHPUSERTRACK_VERSION;
  28.  
  29. /* PHP module capabilities. */
  30. $module_list array (
  31.     'mysqli' => array (
  32.         'descrip' => 'MySQLi Support',
  33.         'fatal' => true,
  34.         'error' => 'phpUserTrack cannot run without MySQLi support in PHP'
  35.     ),
  36.     'gd' => array (
  37.         'descrip' => _('GD Graphics Library'),
  38.         'fatal' => true,
  39.         'error' => 'Provides dynamic graph images'
  40.     ),
  41.     'tidy' => array (
  42.         'descrip' => 'HTML Tidy Support',
  43.         'fatal' => false,
  44.         'error' => 'Provides HTML cleanup'
  45.     )
  46. );
  47.  
  48. $pear_list array(     
  49.     'Net_GeoIP' => array(         
  50.         'path' => 'Net/GeoIP.php',         
  51.         'error' => 'You do not have the GeoIP package installed on your system. ' .
  52.                     'Lots of cool functionality comes from installing it, so you should :P',
  53.         'required' => false    
  54.         ),
  55.     'MDB2' => array(         
  56.         'path' => 'MDB2.php',         
  57.         'error' => 'Database abstraction layer.',
  58.         'required' => true    
  59.         ),
  60.     'MDB2 MySQL Driver' => array(         
  61.         'path' => 'MDB2/Driver/mysql.php',         
  62.         'error' => 'MySQL Database abstraction layer.',
  63.         'required' => false    
  64.         ),
  65.     'MDB2 MySQLi Driver' => array(         
  66.         'path' => 'MDB2/Driver/mysqli.php',         
  67.         'error' => 'MySQLi Database abstraction layer.',
  68.         'required' => true    
  69.         ),
  70.     'Structures Graph' => array(
  71.         'path' => 'Structures/Graph.php',
  72.         'error' => 'Directed Graph Package',
  73.         'required' => true
  74.         ),
  75.     'Cache Lite' => array(         
  76.         'path' => 'Cache/Lite.php',         
  77.         'error' => 'Caching framework. Speeds up page display.',
  78.         'required' => false    
  79.         )
  80.     )
  81.  
  82. /* Required configuration files. */
  83. $file_list array (
  84.     'conf/conf.php' => null
  85. );
  86.  
  87. $module_output $phpUserTrack_test->phpModuleCheck($module_list);
  88. $config_output $phpUserTrack_test->requiredFileCheck($file_list);
  89. $pear_output $phpUserTrack_test->PEARModuleCheck($pear_list);
  90. ?>
  91.  
  92. <html>
  93. <head>
  94. <title>phpUserTrack System Capabilities Test</title>
  95. <link href="style.css" rel="stylesheet" type="text/css" />
  96. </head>
  97. <body>
  98. <h1>phpUserTrack System Capabilities Test (version <?php echo PHPUSERTRACK_VERSION?>)</h1>
  99. <div id="container">
  100. <?php
  101.  
  102.  
  103. /* Display PHP Version information. */
  104. $php_info $phpUserTrack_test->getPhpVersionInformation();
  105. ?>
  106. <h2>PHP Version</h2>
  107. <ul>
  108.     <li>PHP Version: <?php echo $php_info->version ?></li>
  109.     <li>PHP Major Version: <?php echo $php_info->major ?></li>
  110. <?php if (isset($php_info->minor))?>
  111.     <li>PHP Minor Version: <?php echo $php_info->minor ?></li>
  112. <?php endif?>
  113. <?php if (isset($php_info->subminor))?>
  114.     <li>PHP Subminor Version: <?php echo $php_info->subminor ?></li>
  115. <?php endif?>
  116.     <li>PHP Version Classification: <?php echo $php_info->class ?></li>
  117.     <li style="color:<?php echo $php_info->status_color ?>"><strong><?php echo $php_info->status ?></strong></li>
  118. <?php if (isset($php_info->version_check))?>
  119.     <li><?php echo $php_info->version_check ?></li>
  120. <?php endif?>
  121. <?php if (isset($php_info->insecure))?>
  122.     <li style="color:orange"><strong><?php echo $php_info->insecure ?><strong></li>
  123. <?php endif?>
  124. </ul>
  125.  
  126. <h2>PHP Module Capabilities</h2>
  127. <ul>
  128.     <?php echo $module_output ?>
  129. </ul>
  130.  
  131. <h2>PEAR</h2>
  132. <ul>
  133.     <?php echo $pear_output ?>
  134. </ul>
  135.  
  136. <h2>Required phpUserTrack Configuration Files</h2>
  137. <ul>
  138.     <?php echo $config_output ?>
  139. </ul>
  140.  
  141. <?php
  142.  
  143. if ($passTests{
  144.     echo '<h2 class="supported">phpUserTrack Passes all tests</h2>';
  145. else {
  146.     echo '<h2 class="notsupported">phpUserTrack Failed tests</h2>';
  147. }
  148.  
  149. echo '<a href="javascript/javatest.html">Test Javascript Submit</a>';
  150.  
  151. ?>
  152.  
  153. </div>
  154. </body>
  155. </html>

Documentation generated on Tue, 06 Nov 2007 09:22:13 -0800 by phpDocumentor 1.4.0a2