install/upgrade.php
changeset 354 979d99a0b00e
child 377 bb3e6c3bd4f4
equal deleted inserted replaced
353:2398420f48e7 354:979d99a0b00e
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
       
     5  * Version 1.1.1
       
     6  * Copyright (C) 2006-2007 Dan Fuhry
       
     7  * Installation package
       
     8  * upgrade.php - Upgrade interface
       
     9  *
       
    10  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
       
    11  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
       
    12  *
       
    13  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
       
    14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
       
    15  */
       
    16 
       
    17 define('IN_ENANO', 1);
       
    18 
       
    19 require_once('includes/common.php');
       
    20 @ini_set('display_errors', 'on');
       
    21 
       
    22 $ui = new Enano_Installer_UI('Enano upgrader', false);
       
    23 if ( version_compare(PHP_VERSION, '5.0.0', '<') )
       
    24 {
       
    25   $ui->__construct('Enano upgrader', false);
       
    26 }
       
    27 $ui->add_stage('Welcome', true);
       
    28 $ui->add_stage('Select version', true);
       
    29 $ui->add_stage('Perform upgrade', true);
       
    30 $ui->add_stage('Finish', true);
       
    31 $stg_php4 = $ui->add_stage('PHP4 compatibility notice', false);
       
    32 
       
    33 if ( version_compare(PHP_VERSION, '5.0.0', '<') || isset($_GET['debug_warn_php4']) )
       
    34 {
       
    35   $ui->set_visible_stage($stg_php4);
       
    36   $ui->step = '';
       
    37   
       
    38   $ui->show_header();
       
    39   
       
    40   // This isn't localized because all localization code is dependent on
       
    41   // PHP 5 (loading lang.php will throw a parser error under PHP4). This
       
    42   // one message probably doesn't need to be localized anyway.
       
    43   
       
    44   ?>
       
    45   <h2 class="heading-error">
       
    46     Your server doesn't have support for PHP 5.
       
    47   </h2>
       
    48   <p>
       
    49     PHP 5 is the latest version of the language on which Enano was built. Its many new features have been available since early 2004, yet
       
    50     many web hosts have not migrated to it because of the work involved. In 2007, Zend Corporation announced that support for the aging
       
    51     PHP 4.x would be discontinued at the end of the year. An initiative called <a href="http://gophp5.org/">GoPHP5</a> was started to
       
    52     encourage web hosts to migrate to PHP 5.
       
    53   </p>
       
    54   <p>
       
    55     Because of the industry's decision to not support PHP 4 any longer, the Enano team decided that it was time to begin using the powerful
       
    56     features of PHP 5 at the expense of PHP 4 compatibility. Therefore, this version of Enano cannot be installed on your server until it
       
    57     is upgraded to at least PHP 5.0.0, and preferably the latest available version.
       
    58     <!-- No, not even removing the check in this installer script will help. As soon as the PHP4 check is passed, the installer shows the
       
    59          language selection page, after which the language code is loaded. The language code and libjson2 will trigger parse errors under
       
    60          PHP <5.0.0. -->
       
    61   </p>
       
    62   <p>
       
    63     If you need to use Enano but can't upgrade your PHP because you're on a shared or reseller hosting service, you can use the
       
    64     <a href="http://enanocms.org/download?series=1.0">1.0.x series of Enano</a> on your site. While the Enano team attempts to make this
       
    65     older series work on PHP 4, official support is not provided for installations of Enano on PHP 4.
       
    66   </p>
       
    67   <?php
       
    68   
       
    69   $ui->show_footer();
       
    70   exit(0);
       
    71 }
       
    72 
       
    73 $ui->show_header();
       
    74 $ui->show_footer();
       
    75