[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/setup/inc/ -> step0.inc.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  $_SESSION['admin_set'] = false;
  24  
  25  ?>
  26  <h1><span class="number">1.</span> Thanks! You have agreed to the GPL.</h1>
  27  <p>Now that you know the <a href="http://www.gnu.org/licenses/licenses.html#GPL" target="_blank"><strong>licence</strong></a> under
  28    which <strong>phpwcms</strong> is released you can continue to install or upgrade <strong>phpwcms</strong>.</p>
  29    
  30  <h1><span class="number">2.</span> Now lets check your server settings</h1>
  31  <p>Please proof all information about your system (recommend PHP 4.3+, MySQL 3.23.50+).</p>
  32  <ol>
  33    <li>WWW server: <strong><?php echo empty($_SERVER['SERVER_SOFTWARE']) ? 'unavailable' : html_specialchars($_SERVER['SERVER_SOFTWARE']) ?></strong></li>
  34    <li>PHP version: <?php 
  35    
  36      echo '<strong>'.html_specialchars(phpversion()).'</strong>';
  37    
  38      switch(version_compare('4.2.1', phpversion())) {
  39    
  40          case -1:    // current used PHP is > OK
  41                      echo '<img src="../img/famfamfam/icon_accept.gif" alt="OK" class="icon1" />';
  42                      if(version_compare('4.4', phpversion()) == 1) {
  43                          echo ' (it is recommend to update your PHP version)';
  44                      }
  45                      break;
  46                  
  47          case  0:    // the same version - HM not recommend
  48                      echo '<img src="../img/famfamfam/icon_alert.gif" alt="OK" class="icon1" />';
  49                      echo ' (your version of PHP is very old - update recommend)';
  50                      break;
  51                  
  52          case  1:    // false it's older
  53                      echo '<img src="../img/famfamfam/action_stop.gif" alt="Stop" class="icon1" />';
  54                      echo ' (your version of PHP is too old - it is not recommend to continue)';
  55                      break;
  56  
  57      }
  58    
  59    
  60     ?></li>
  61    <li>MySQL version: <?php  
  62    
  63      echo '<strong>'.html_specialchars(mysql_get_client_info()) .'</strong>';
  64  
  65      switch(version_compare('3.23.50', mysql_get_client_info())) {
  66    
  67          case -1:    // current MySQL isOK
  68                      echo '<img src="../img/famfamfam/icon_accept.gif" alt="OK" class="icon1" />';
  69                      break;
  70                  
  71          default:    // the same version or older
  72                      echo '<img src="../img/famfamfam/icon_alert.gif" alt="OK" class="icon1" />';
  73                      echo ' (update recommend)';
  74  
  75      }  
  76    
  77    ?></li>
  78    <li>PHP settings<a href="http://www.php.net/manual/security.php" target="_blank" title="PHP Security"><img src="../img/famfamfam/icon_info.gif" alt="Security risks" class="icon1" border="0" /></a>
  79        <ul>
  80        <li><strong>register_globals </strong><?php
  81            
  82            if(ini_get('register_globals')) {
  83                echo '<strong>On</strong>';
  84              echo '<img src="../img/famfamfam/icon_alert.gif" alt="OK" class="icon1" />';
  85              echo ' (should always be set Off';
  86              echo '<a href="http://phpsec.org/projects/guide/1.html#1.3" target="_blank">';
  87              echo '<img src="../img/famfamfam/icon_info.gif" alt="Security risks" class="icon1" border="0" />';
  88              echo '</a>)';
  89            } else {
  90              echo '<strong>Off</strong>';
  91              echo '<img src="../img/famfamfam/icon_accept.gif" alt="OK" class="icon1" />';
  92            }
  93            
  94            ?>
  95        </li>
  96        <li><strong>safe_mode </strong><?php
  97            
  98            if(ini_get('safe_mode')) {
  99                echo '<strong>On</strong>';
 100              echo '<img src="../img/famfamfam/icon_accept.gif" alt="OK" class="icon1" />';
 101              echo ' (limited permissions, but recommend)';
 102            } else {
 103              echo '<strong>Off</strong>';
 104              echo '<img src="../img/famfamfam/icon_alert.gif" alt="Warning" class="icon1" />';
 105              echo ' (check information about security risks';
 106              echo '<a href="http://www.php.net/features.safe-mode" target="_blank">';
 107              echo '<img src="../img/famfamfam/icon_info.gif" alt="Security risks" class="icon1" border="0" />';
 108              echo '</a>)';
 109            }
 110            
 111            ?></li>
 112          <li><?php
 113        
 114                    $_phpinfo = parsePHPModules();
 115                  if(isset($_phpinfo['gd']['GD Support']) && $_phpinfo['gd']['GD Support'] == 'enabled' && isset($_phpinfo['gd']['GD Version'])) {
 116                      $_phpinfo['gd_version'] = html_specialchars($_phpinfo['gd']['GD Version']);
 117                  } else {
 118                      $_phpinfo['gd_version'] = 'n.a.';
 119                  }
 120        
 121                    echo '<strong>GD';
 122                  
 123                  if(function_exists('imagegd2')) {
 124                      echo '2</strong> '.$_phpinfo['gd_version'];
 125                      echo '<img src="../img/famfamfam/icon_accept.gif" alt="GD2" class="icon1" />';
 126                      $is_gd = true;
 127                  } elseif(function_exists('imagegd')) {
 128                      echo '1</strong> '.$_phpinfo['gd_version'];
 129                      echo '<img src="../img/famfamfam/icon_alert.gif" alt="GD1" class="icon1" />';
 130                      echo ' (GD2 is recommend)';
 131                      $is_gd = true;
 132                  } else {
 133                      echo ' not available</strong>';
 134                      echo '<img src="../img/famfamfam/action_stop.gif" alt="GD not present" class="icon1" />';
 135                      $is_gd = false;
 136                  }
 137                  
 138                  if($is_gd) {
 139                      
 140                      $is_gd = array();
 141                  
 142                      if(imagetypes() & IMG_GIF) {
 143                          $is_gd[] = 'GIF<img src="../img/famfamfam/icon_accept.gif" alt="GIF supported" class="icon1" />';
 144                      } else {
 145                          $is_gd[] = 'GIF<img src="../img/famfamfam/action_stop.gif" alt="GIF not supported" class="icon1" />';
 146                      }
 147                      if(imagetypes() & IMG_PNG) {
 148                          $is_gd[] = 'PNG<img src="../img/famfamfam/icon_accept.gif" alt="PNG supported" class="icon1" />';
 149                      } else {
 150                          $is_gd[] = 'PNG<img src="../img/famfamfam/action_stop.gif" alt="PNG not supported" class="icon1" />';
 151                      }
 152                      if(imagetypes() & IMG_JPG) {
 153                          $is_gd[] = 'JPG<img src="../img/famfamfam/icon_accept.gif" alt="JPG supported" class="icon1" />';
 154                      } else {
 155                          $is_gd[] = 'JPG<img src="../img/famfamfam/action_stop.gif" alt="JPG not supported" class="icon1" />';
 156                      }
 157                      
 158                      echo '<br />Image types supported: '.implode('/ ', $is_gd);
 159                  
 160                  }
 161  
 162          ?></li>
 163        </ul>
 164    </li>
 165  </ol>
 166  <p><strong>phpwcms</strong> has
 167    automatic image resizing capabilities. This works very well for standard graphics
 168    file formats like JPEG, GIF and PNG as long as your PHP installation has built-in
 169    support for <a href="http://en.wikipedia.org/wiki/GD_Graphics_Library" target="_blank">GD</a> &#8212; <strong>GD2</strong> with
 170    freetype support is always recommend. <strong>Note:</strong> It
 171    is not neccessary but recommend that you have installed <a href="http://www.imagemagick.org" target="_blank">ImageMagick</a> and <a href="http://www.ghostscript.com/" target="_blank">GhostScript</a> on
 172    your server system which enables image resizing for nearly every
 173    graphics file format.</p>
 174  <?php
 175  
 176  // is the setup config file writable
 177  if(!is_writable("setup.conf.inc.php")) {
 178  
 179      if(!@chmod("setup.conf.inc.php", 0666)) {
 180      
 181      echo errorWarning('The file <i>setup.conf.inc.php</i> in which all values are stored is NOT writable.');
 182      
 183      ?><p>Please correct this problem before you can continue (connect to your account by FTP and permissions to chmod 777).</p>
 184  <?php
 185    
 186        }
 187  } else {
 188  
 189  ?>
 190  <form action="setup.php?step=1" method="post">
 191      <input name="Submit" type="submit" value="Start setup of phpwcms" />
 192        &nbsp;&nbsp;
 193      <input name="Submit" type="submit" value="Upgrade existing installation" onclick="window.location.href='upgrade.php';return false;" />
 194  </form>
 195  <?php
 196  }
 197  ?>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7