From 682220bded5b06a15943d2c0b65978fbcf3c43f1 Mon Sep 17 00:00:00 2001 From: patdenice Date: Wed, 15 Oct 2008 17:50:12 +0000 Subject: - 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. git-svn-id: http://piwigo.org/svn/trunk@2747 68402e56-0260-453c-a942-63ccdbb3a9ee --- install.php | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'install.php') diff --git a/install.php b/install.php index f629fb06e..ac8577943 100644 --- a/install.php +++ b/install.php @@ -21,6 +21,12 @@ // | USA. | // +-----------------------------------------------------------------------+ +//------------------------------------------------- check php version +if (version_compare(PHP_VERSION, '5', '<')) +{ + die('Piwigo requires PHP 5 or above.'); +} + //----------------------------------------------------------- include define('PHPWG_ROOT_PATH','./'); @@ -210,7 +216,7 @@ load_language( 'admin.lang', '', array('language'=>$language, 'target_charset'=> load_language( 'install.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); //----------------------------------------------------- template initialization -$template=new Template(PHPWG_ROOT_PATH.'template/yoga', 'clear'); +$template=new Template(PHPWG_ROOT_PATH.'admin/template/goto', 'roma'); $template->set_filenames( array('install'=>'install.tpl') ); $step = 1; //---------------------------------------------------------------- form analyze @@ -290,7 +296,10 @@ define(\'DB_COLLATE\', \'\'); { $html_content = htmlentities( $file_content, ENT_QUOTES ); $html_content = nl2br( $html_content ); - $template->assign('error_copy', $html_content); + $error_copy = l10n('step1_err_copy'); + $error_copy .= '
--------------------------------------------------------------------
'; + $error_copy .= '' . $html_content . ''; + $error_copy .= '
--------------------------------------------------------------------
'; } @fputs($fp, $file_content, strlen($file_content)); @fclose($fp); @@ -388,6 +397,19 @@ $template->assign( )); //------------------------------------------------------ errors & infos display +if ($step == 1) +{ + $template->assign('install', true); +} +else +{ + array_push($infos, l10n('install_end_message')); + + if (isset($error_copy)) + { + array_push($errors, $error_copy); + } +} if (count($errors) != 0) { $template->assign('errors', $errors); @@ -398,11 +420,6 @@ if (count($infos) != 0 ) $template->assign('infos', $infos); } -if ($step == 1) -{ - $template->assign('install', true); -} - //----------------------------------------------------------- html code display $template->pparse('install'); ?> -- cgit v1.2.3