Changeset 2747 for trunk/install.php


Ignore:
Timestamp:
Oct 15, 2008, 7:50:12 PM (16 years ago)
Author:
patdenice
Message:
  • Install process now looks like goto/roma.
  • Move install.tpl to goto template.
  • add charset utf8 to fatal error function.
  • Check php version on install and upgrade, and die if < 5.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/install.php

    r2700 r2747  
    2222// +-----------------------------------------------------------------------+
    2323
     24//------------------------------------------------- check php version
     25if (version_compare(PHP_VERSION, '5', '<'))
     26{
     27  die('Piwigo requires PHP 5 or above.');
     28}
     29
    2430//----------------------------------------------------------- include
    2531define('PHPWG_ROOT_PATH','./');
     
    211217
    212218//----------------------------------------------------- template initialization
    213 $template=new Template(PHPWG_ROOT_PATH.'template/yoga', 'clear');
     219$template=new Template(PHPWG_ROOT_PATH.'admin/template/goto', 'roma');
    214220$template->set_filenames( array('install'=>'install.tpl') );
    215221$step = 1;
     
    291297      $html_content = htmlentities( $file_content, ENT_QUOTES );
    292298      $html_content = nl2br( $html_content );
    293       $template->assign('error_copy', $html_content);
     299      $error_copy = l10n('step1_err_copy');
     300      $error_copy .= '<br />--------------------------------------------------------------------<br />';
     301      $error_copy .= '<span class="sql_content">' . $html_content . '</span>';
     302      $error_copy .= '<br />--------------------------------------------------------------------<br />';
    294303    }
    295304    @fputs($fp, $file_content, strlen($file_content));
     
    389398
    390399//------------------------------------------------------ errors & infos display
     400if ($step == 1)
     401{
     402  $template->assign('install', true);
     403}
     404else
     405{
     406  array_push($infos, l10n('install_end_message'));
     407
     408  if (isset($error_copy))
     409  {
     410    array_push($errors, $error_copy);
     411  }
     412}
    391413if (count($errors) != 0)
    392414{
     
    397419{
    398420  $template->assign('infos', $infos);
    399 }
    400 
    401 if ($step == 1)
    402 {
    403   $template->assign('install', true);
    404421}
    405422
Note: See TracChangeset for help on using the changeset viewer.