diff options
author | patdenice <patdenice@piwigo.org> | 2008-10-15 17:50:12 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2008-10-15 17:50:12 +0000 |
commit | 682220bded5b06a15943d2c0b65978fbcf3c43f1 (patch) | |
tree | 77f0fd0148158bd1e03c9f9fba058f5fbf72c174 /install.php | |
parent | 847a842e8d4ed1855838f5d8ab514fbf22cb164b (diff) |
- 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
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'); ?> |