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

Source for file install.php

Documentation is available at install.php

  1. <?php
  2.  
  3. if (!include_once './lib/libTest.php'{
  4.     /* Try and provide enough information to debug the missing file. */
  5.     echo '<br /><span class="notsupported">Unable to find phpUserTrack/lib/libTest.php. ' .
  6.     'Your phpUserTrack installation may be missing critical files, or PHP may not ' .
  7.     'have sufficient permissions to include files. There may be error messages printed ' .
  8.     'above this message that will help you in debugging the problem.</span>';
  9.     exit;
  10. }
  11.  
  12. $phpUserTrack_test new phpUserTrack_Test();
  13.  
  14. /* phpUserTrack definitions. */
  15. $module 'phpUserTrack';
  16. require_once './include/version.php';
  17. $module_version PHPUSERTRACK_VERSION;
  18.  
  19. $templates_c_perm substr(sprintf('%o'fileperms('templates_c'))-4);
  20. $browscap_perm substr(sprintf('%o'fileperms('include/browscap.ini'))-4);
  21. $conf file_exists('conf/conf.php');
  22.  
  23. $module_list array (
  24.     'mysqli' => array (
  25.         'descrip' => 'MySQLi Support',
  26.         'fatal' => true,
  27.         'error' => 'phpUserTrack cannot run without MySQLi support in PHP'
  28.     ),
  29.     'gd' => array (
  30.         'descrip' => _('GD Graphics Library'),
  31.         'fatal' => true,
  32.         'error' => 'Provides dynamic graph images'
  33.     ),
  34. );
  35.  
  36. $pear_list array(     
  37.     'Net_GeoIP' => array(         
  38.         'path' => 'Net/GeoIP.php',         
  39.         'error' => 'You do not have the GeoIP package installed on your system. ' .
  40.                     'Lots of cool functionality comes from installing it, so you should :P',
  41.         'required' => false    
  42.         ),
  43.     'MDB2' => array(         
  44.         'path' => 'MDB2.php',         
  45.         'error' => 'Database abstraction layer.',
  46.         'required' => true    
  47.         ),
  48.     'MDB2 MySQL Driver' => array(         
  49.         'path' => 'MDB2/Driver/mysql.php',         
  50.         'error' => 'MySQL Database abstraction layer.',
  51.         'required' => false    
  52.         ),
  53.     'MDB2 MySQLi Driver' => array(         
  54.         'path' => 'MDB2/Driver/mysqli.php',         
  55.         'error' => 'MySQLi Database abstraction layer.',
  56.         'required' => true    
  57.         ),
  58.     )
  59.     
  60. $module_output $phpUserTrack_test->phpModuleCheck($module_list);
  61. $pear_output $phpUserTrack_test->PEARModuleCheck($pear_list);
  62.  
  63. function success_fail($test$want$msg null{
  64.     if ($test == $want{
  65.         return '<img src="images/success.png" /><br />';
  66.     else {
  67.         return '<img src="images/error.png" />&nbsp;&nbsp;<strong>' $msg '</strong><br />';
  68.     }
  69.     
  70. }
  71.  
  72. ?>
  73. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  74.  
  75.  
  76. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  77.   <head>
  78.   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  79.   <title>phpUserTrack Admin Page</title>
  80.   <script type="text/javascript" src="javascript/nicetitle.js"></script>
  81.   <link href="style.css" rel="stylesheet" type="text/css" />
  82.   <script type="text/javascript" src="http://localhost/phpusertrack/javascript/phpusertrack.js.php?site=31"> </script>
  83.  
  84.   </head>
  85.   <body>
  86.   
  87.   <h1 style="margin: 0px;"><img src="images/logo.png" /></h1>
  88.   
  89.     
  90.   <div id="container">
  91.   
  92.     <h2>Installation</h2>
  93.     
  94.     <h3>File Permissions</h3>
  95.     <em>templates_c</em> Directory Permission: 
  96.     <?php 
  97.         echo success_fail($templates_c_perm'0755''Please run <code>chmod 755 templates_c</code> in the root phpUserTrack directory');
  98.     ?>
  99.     <em>browscap.ini</em> File Permission: 
  100.     <?php 
  101.         echo success_fail($browscap_perm'0777''Please run <code>chmod 777 include/browscap.ini</code> in the root phpUserTrack directory');
  102.     ?>
  103.     
  104.     <h3>Configuration</h3>
  105.     <em>conf.php</em> Configuration File Exists: 
  106.     <?php 
  107.         echo success_fail($conftrue'Please copy conf/conf.php.dist to conf/conf.php and edit the file to match your configuration');
  108.     ?>
  109.     
  110.     <h3>PHP Module Capabilities</h3>
  111. <ul>
  112.     <?php echo $module_output ?>
  113. </ul>
  114.  
  115. <h3>PEAR</h3>
  116. <ul>
  117.     <?php echo $pear_output ?>
  118. </ul>
  119.  
  120. </div>
  121.  
  122. </body>
  123. </html>

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