[Easymod-cvs] easymod/install em_install.php,1.3,1.4
Status: Beta
Brought to you by:
wgeric
|
From: Eric F. <wg...@us...> - 2005-12-24 01:44:03
|
Update of /cvsroot/easymod/easymod/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29382 Modified Files: em_install.php Log Message: - a semi decent error reporting system - semi decent debug information for installer - remove trailing white space on the ends of lines, haven't done every file - some minor bug fixes Index: em_install.php =================================================================== RCS file: /cvsroot/easymod/easymod/install/em_install.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** em_install.php 22 Dec 2005 00:33:31 -0000 1.3 --- em_install.php 24 Dec 2005 01:43:42 -0000 1.4 *************** *** 502,551 **** // general debug information // ! $debug = array(); ! ! // php version ! $debug['general']['php_version'] = phpversion(); ! ! // phpbb version ! $debug['general']['phpbb_version'] = '2' . $board_config['version']; ! ! // easymod version ! $debug['general']['em_version'] = ( !empty($board_config['em_version']) ) ? $board_config['em_version'] : $lang['EM_Not_installed']; ! $debug['general']['em_install_version'] = EM_INSTALL_VERSION; ! ! // check writing temp files ! $tmp = true; ! if ( $tmpfname = @tempnam(( ( !empty($board_config['em_tmp_path']) ) ? $board_config['em_tmp_path'] : '/tmp'), 'em_')) ! { ! @unlink($tmpfname); ! ! if ( $fp = @fopen($tmpfname, 'w') ) ! { ! // remember to clean up! ! @fwrite($fp, "EM TEST\n"); ! @fclose($fp); ! @unlink($tmpfname); ! ! $debug['general']['tmp_write'] = true; ! } ! else ! { ! $debug['general']['tmp_write'] = false; ! } ! } ! else ! { ! $debug['general']['tmp_write'] = false; ! } ! ! // safe mode? ! if ( @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on' ) ! { ! $debug['general']['safe_mode'] = $lang['EM_On']; ! } ! else ! { ! $debug['general']['safe_mode'] = $lang['EM_Off']; ! } ?> <tr valign="top"> --- 502,509 ---- // general debug information // ! $temp = load_debug(); ! $debug = $temp['debug']; ! $method_files = $temp['methods']; ! unset($temp); ?> <tr valign="top"> *************** *** 557,570 **** <?php - // load the methods and the debug information - $method_files = array(); - $methods = load_methods('install/em_files/'); - for($i = 0, $total = sizeof($methods); $i < $total; $i++) - { - include($phpbb_root_path . $em_dir . 'includes/em/em_methods_' . $methods[$i]['file'] . '.'. $phpEx); - $mod_io->test($debug, $methods[$i]['name']); - $method_files[$methods[$i]['name']] = $methods[$i]['file']; - } - $allowed_methods = '<select name="method">'; foreach($debug as $method => $options) --- 515,518 ---- *************** *** 761,772 **** } ! function em_debug_display() { ! global $board_config, $lang, $mod_io; ! global $sel_method, $tmp_path; ! global $ftp_host, $ftp_port, $ftp_timeout, $ftp_username, $ftp_password, $ftp_root_path; ! $tmp_write = false; ! if ( $tmpfname = @tempnam(( ( !empty($tmp_path) ) ? $tmp_path : '/tmp'), 'em_')) { @unlink($tmpfname); --- 709,735 ---- } ! ! function load_debug() { ! global $board_config, $phpEx, $phpbb_root_path, $em_dir, $lang, $mod_io; ! // ! // general debug information ! // ! $debug = array(); ! ! // php version ! $debug['general']['php_version'] = phpversion(); ! ! // phpbb version ! $debug['general']['phpbb_version'] = '2' . $board_config['version']; ! ! // easymod version ! $debug['general']['em_version'] = ( !empty($board_config['em_version']) ) ? $board_config['em_version'] : $lang['EM_Not_installed']; ! $debug['general']['em_install_version'] = EM_INSTALL_VERSION; ! ! // check writing temp files ! $tmp = true; ! if ( $tmpfname = @tempnam(( ( !empty($board_config['em_tmp_path']) ) ? $board_config['em_tmp_path'] : '/tmp'), 'em_')) { @unlink($tmpfname); *************** *** 779,829 **** @unlink($tmpfname); ! $tmp_write = true; } else { ! $tmp_write = false; } } else { ! $tmp_write = false; } - ?> - <strong>[b]PHP Version[/b]</strong>: <?php echo phpversion(); ?><br /> - <strong>[b]phpBB Version[/b]</strong>: 2.<?php echo $board_config['version']; ?><br /> - <strong>[b]EM Version[/b]</strong>: <?php echo ( !empty($board_config['em_version']) ) ? $board_config['em_version'] : $lang['EM_Not_installed']; ?><br /> - <strong>[b]EM Install Version[/b]</strong>: <?php echo EM_INSTALL_VERSION; ?><br /> - <strong>[b]TMP Write Access[/b]</strong>: <?php echo ( $tmp_write ) ? '[color=green]' . $lang['EM_Passed'] . '[/color]': '[color=red]' . $lang['EM_Failed'] . '[/color]'; ?><br /> - <strong>[b]Safe Mode[/b]</strong>: <?php echo ( @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on' ) ? 'On' : 'Off'; ?><br /><br /> ! <strong>[b]Selected Method[/b]</strong>: <?php echo $sel_method; ?><br /> ! <strong>[b]Tmp Path[/b]</strong>: <?php echo $tmp_path; ?><br /> ! <strong>[b]FTP Host[/b]</strong>: <?php echo $ftp_host; ?><br /> ! <strong>[b]FTP Port[/b]</strong>: <?php echo $ftp_port; ?><br /> ! <strong>[b]FTP Timeout[/b]</strong>: <?php echo $ftp_timeout; ?><br /> ! <strong>[b]FTP Username[/b]</strong>: <?php echo $ftp_username; ?><br /> ! <strong>[b]FTP Password[/b]</strong>: <?php echo ( !empty($ftp_password) ) ? '********' : 'None'; ?><br /> ! <strong>[b]FTP Root Path[/b]</strong>: <?php echo $ftp_root_path; ?><br /><br /> ! <?php ! $test_results = $mod_io->test_connection(); ! ?> ! <br /><br /> ! <?php ! $debug = array(); ! $mod_io->test($debug, 'temp'); ! foreach($debug['temp'] as $option => $allowed) { ! if ( $option == 'allowed' ) { ! continue; ! } ?> ! <strong>[b]<?php echo ( isset($lang['EM_' . $option]) ) ? $lang['EM_' . $option] : str_replace('_', ' ', $option); ?>[/b]</strong>: <?php if ( is_bool($allowed) ) { echo ( $allowed ) ? '[color=green]' . $lang['EM_Passed'] . '[/color]': '[color=red]' . $lang['EM_Failed'] . '[/color]'; } else { echo $allowed; } ?><br /> <?php } - - return; } --- 742,826 ---- @unlink($tmpfname); ! $debug['general']['tmp_write'] = true; } else { ! $debug['general']['tmp_write'] = false; } } else { ! $debug['general']['tmp_write'] = false; } ! // safe mode? ! if ( @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on' ) ! { ! $debug['general']['safe_mode'] = $lang['EM_On']; ! } ! else ! { ! $debug['general']['safe_mode'] = $lang['EM_Off']; ! } ! // load the methods and the debug information ! $method_files = array(); ! $methods = load_methods('install/em_files/'); ! for($i = 0, $total = sizeof($methods); $i < $total; $i++) { ! include($phpbb_root_path . $em_dir . 'includes/em/em_methods_' . $methods[$i]['file'] . '.'. $phpEx); ! $mod_io->test($debug, $methods[$i]['name']); ! $method_files[$methods[$i]['name']] = $methods[$i]['file']; ! } ! ! return array('debug' => $debug, 'methods' => $method_files); ! } ! ! function em_debug_display() ! { ! global $lang, $board_config; ! global $sel_method, $tmp_path; ! global $ftp_host, $ftp_port, $ftp_timeout, $ftp_username, $ftp_password, $ftp_root_path; ! ! $debug['settings'] = array( ! 'sel_method' => $sel_method, ! 'ftp_host' => $ftp_host, ! 'ftp_port' => $ftp_port, ! 'ftp_username' => $ftp_username, ! 'ftp_password' => ( !empty($ftp_password) ) ? '*******' : $lang['EM_No_password'], ! 'ftp_timeout' => $ftp_timeout, ! 'ftp_root_path' => $ftp_root_path, ! ); ! $debug['system'] = array( ! 'domain' => $board_config['server_name'], ! 'script_path' => $board_config['script_path'], ! 'current_file' => $_SERVER['SCRIPT_FILENAME'], ! 'register_globals' => ( @ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' ) ? $lang['EM_On'] : $lang['EM_Off'], ! 'magic_quote_gpc' => ( @get_magic_quotes_gpc() ) ? $lang['EM_On'] : $lang['EM_Off'], ! 'magic_quotes_runtime' => ( @get_magic_quotes_runtime() ) ? $lang['EM_On'] : $lang['EM_Off'], ! 'loaded_extensions' => implode(', ', @get_loaded_extensions()), ! ); ! ! $temp = load_debug(); ! $debug = array_merge($debug, $temp['debug']); ! $methods = $temp['methods']; ! ! foreach($debug as $method => $options) ! { ! $method_lang = ( isset($lang['EM_' . $method]) ) ? $lang['EM_' . $method] : str_replace('_', ' ', $method); ! ?> ! <h3>[size=18][b]<?php echo $method_lang; ?>[/b][/size]</h3> ! <?php ! foreach($options as $option => $allowed) { ! if ( $option != 'allowed' ) ! { ?> ! <strong>[b]<?php echo ( isset($lang['EM_' . $option]) ) ? $lang['EM_' . $option] : str_replace('_', ' ', $option); ?>[/b]</strong>: <?php if ( is_bool($allowed) ) { echo ( $allowed ) ? '[color=green]' . $lang['EM_Passed'] . '[/color]' : '[color=red]' . $lang['EM_Failed'] . '[/color]'; } else { echo $allowed; } ?><br /> <?php + } + } + echo '<br />'; } } |