diff options
author | patdenice <patdenice@piwigo.org> | 2008-10-15 17:55:18 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2008-10-15 17:55:18 +0000 |
commit | 5ce101c1939bcea8b3171d3d0cf494b35a9650f3 (patch) | |
tree | 1ee1b5fe12447f52f7d37a44193d460a1f6a99c2 /install.php | |
parent | fd1badf24b962381f2600abbe9d2714f1f463005 (diff) |
Merge from trunk 2747:
- 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/branches/2.0@2748 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'install.php')
-rw-r--r-- | install.php | 31 |
1 files changed, 24 insertions, 7 deletions
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 .= '<br />--------------------------------------------------------------------<br />'; + $error_copy .= '<span class="sql_content">' . $html_content . '</span>'; + $error_copy .= '<br />--------------------------------------------------------------------<br />'; } @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'); ?> |