[Easymod-cvs] easymod/install/em_files/admin em_general.php,1.2,1.3 em_history.php,1.2,1.3 em_logs.p
Status: Beta
Brought to you by:
wgeric
|
From: Eric F. <wg...@us...> - 2005-12-24 01:44:07
|
Update of /cvsroot/easymod/easymod/install/em_files/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29382/em_files/admin Modified Files: em_general.php em_history.php em_logs.php em_manage.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_general.php =================================================================== RCS file: /cvsroot/easymod/easymod/install/em_files/admin/em_general.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** em_general.php 7 Dec 2005 00:31:20 -0000 1.2 --- em_general.php 24 Dec 2005 01:43:42 -0000 1.3 *************** *** 44,48 **** --- 44,50 ---- } + $template->assign_var_from_handle('EM_HEADER', 'em_head'); $template->pparse('body'); + include('page_footer_admin.'.$phpEx); exit; } *************** *** 170,173 **** --- 172,176 ---- // Show Page // + $template->assign_var_from_handle('EM_HEADER', 'em_head'); $template->pparse('body'); include('page_footer_admin.'.$phpEx); Index: em_logs.php =================================================================== RCS file: /cvsroot/easymod/easymod/install/em_files/admin/em_logs.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** em_logs.php 4 Dec 2005 03:12:30 -0000 1.1 --- em_logs.php 24 Dec 2005 01:43:42 -0000 1.2 *************** *** 1,8 **** <?php ! /** * * @package EasyMOD * @version $Id$ ! * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * --- 1,8 ---- <?php ! /** * * @package EasyMOD * @version $Id$ ! * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * *************** *** 157,164 **** 'L_DELETE_ALL' => $lang['Delete_all'] )); ! // // Show Page // $template->pparse('body'); include('page_footer_admin.'.$phpEx); --- 157,165 ---- 'L_DELETE_ALL' => $lang['Delete_all'] )); ! // // Show Page // + $template->assign_var_from_handle('EM_HEADER', 'em_head'); $template->pparse('body'); include('page_footer_admin.'.$phpEx); Index: em_manage.php =================================================================== RCS file: /cvsroot/easymod/easymod/install/em_files/admin/em_manage.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** em_manage.php 22 Dec 2005 01:02:10 -0000 1.5 --- em_manage.php 24 Dec 2005 01:43:42 -0000 1.6 *************** *** 124,127 **** --- 124,128 ---- // Display MOD actions + $err = false; foreach( $mod_parser->actions as $action => $action_data ) { *************** *** 154,164 **** $file_dir = dirname($target_file); $edit_file = $processed_dir . '/' . $file_dir . '/' . basename($target_file) . '.txt'; ! $mod_io->make_dir($processed_dir . '/' . $file_dir); ! $mod_io->copy_file($target_file, $edit_file); if ( !$modder->open($edit_file) ) { em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_open', $target_file); } display_mod_action('processed', $action, $target_file); for( $i = 0, $total = sizeof($target_actions['edit']); $i < $total; $i++ ) --- 155,180 ---- $file_dir = dirname($target_file); $edit_file = $processed_dir . '/' . $file_dir . '/' . basename($target_file) . '.txt'; ! ! if (!$mod_io->make_dir($processed_dir . '/' . $file_dir)) ! { ! $err = true; ! em_trigger_error(EM_ERR_CRITICLAL, 'EM_Err_mkdir', $processed_dir . '/' . $file_dir); ! break; ! } ! ! if (!$mod_io->copy_file($target_file, $edit_file)) ! { ! $err = true; ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_move', $target_file . ' -> ' . $edit_file); ! break; ! } if ( !$modder->open($edit_file) ) { em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_open', $target_file); + $err = true; + break; } + display_mod_action('processed', $action, $target_file); for( $i = 0, $total = sizeof($target_actions['edit']); $i < $total; $i++ ) *************** *** 170,173 **** --- 186,191 ---- { em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_find', $actions_data['find'], $target_file); + $err = true; + break; } display_mod_action('processed', 'find', $actions_data['find']); *************** *** 183,186 **** --- 201,206 ---- { em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_' . $action_func, $action_data['code']); + $err = true; + break; } $block = 'processed'; *************** *** 202,205 **** --- 222,227 ---- { em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_inline_find', $actions_data['find'], $target_file); + $err = true; + break; } display_mod_action('processed', 'in-line-find', $inlines_data['in-line-find']); *************** *** 215,218 **** --- 237,242 ---- { em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_' . $action_func, $action_data['code']); + $err = true; + break; } $block = 'processed'; *************** *** 224,230 **** --- 248,269 ---- display_mod_action($block, $inline_data['type'], $inline_data['code']); } + + if ( $err == true ) + { + break; + } + } + + if ( $err === true ) + { + break; } } $modder->close(); + + if ( $err === true ) + { + break; + } } break; *************** *** 249,252 **** --- 288,301 ---- } } + + if ( $err === true ) + { + break; + } + } + + if ( $err === false ) + { + $template->assign_block_vars('switch_next_step', array()); } *************** *** 280,283 **** --- 329,333 ---- { $sql = $mod_parser->actions['sql']; + $err = false; for( $i = 0, $total = sizeof($sql); $i < $total; $i++ ) *************** *** 289,293 **** if( $result & SQL_PARSER_ERROR ) { ! message_die(GENERAL_ERROR, '<b>Error:</b><br />' . $sql_parser->error_message['message'] . '<br /><br /><b>SQL:</b><br />' . $sql_parser->sql_input[$sql_parser->sql_count]); } if( $result & SQL_PARSER_WARNINGS ) --- 339,344 ---- if( $result & SQL_PARSER_ERROR ) { ! em_trigger_error(EM_ERR_CRTICAL, $sql_parser->error_message['message'], $sql_parser->sql_input[$sql_parser->sql_count]); ! $err = true; } if( $result & SQL_PARSER_WARNINGS ) *************** *** 295,299 **** for( $i = 0, $total = sizeof($sql_parser->warnings); $i < $total; $i++ ) { ! em_trigger_error(EM_ERR_WARNING, 'SQL Warning', $sql_parser->warnings[$i]); } } --- 346,350 ---- for( $i = 0, $total = sizeof($sql_parser->warnings); $i < $total; $i++ ) { ! em_trigger_error(EM_ERR_WARNING, $sql_parser->warnings[$i]['message']); } } *************** *** 314,317 **** --- 365,373 ---- } + if ( $err === false ) + { + $template->assign_block_vars('switch_next_step', array()); + } + $hidden_ary = array( 'mode' => 'install', *************** *** 354,358 **** { $status = false; ! vd(array($sql[$i], $db->sql_error())); } --- 410,414 ---- { $status = false; ! em_trigger_error(EM_ERR_WARNING, 'EM_Err_executing_sql', $sql[$i] . "\n\n" . $db->sql_error()); } *************** *** 429,433 **** if ( !$mod_io->make_dir($backup_dir . '/' . dirname($target_file)) ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_mkdir_backup', $backup_dir . '/' . dirname($target_file)); } --- 485,490 ---- if ( !$mod_io->make_dir($backup_dir . '/' . dirname($target_file)) ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_mkdir', $backup_dir . '/' . dirname($target_file)); ! break; } *************** *** 435,439 **** if ( !$mod_io->copy_file($target_file, $backup_dir . '/' . $target_file . '.txt') ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_move_backup', $target_file); } --- 492,497 ---- if ( !$mod_io->copy_file($target_file, $backup_dir . '/' . $target_file . '.txt') ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_move', $target_file); ! break; } *************** *** 468,477 **** if ( !$mod_io->make_dir(dirname($copy_files[$i]['to'])) ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_mkdir_file', dirname($copy_files[$i]['to'])); } if ( !$mod_io->copy_file($copy_files[$i]['from'], $copy_files[$i]['to']) ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_move_file', $copy_files[$i]['from']); } --- 526,537 ---- if ( !$mod_io->make_dir(dirname($copy_files[$i]['to'])) ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_mkdir', dirname($copy_files[$i]['to'])); ! break; } if ( !$mod_io->copy_file($copy_files[$i]['from'], $copy_files[$i]['to']) ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_move', $copy_files[$i]['from']); ! break; } *************** *** 527,530 **** --- 587,591 ---- // Display MOD actions + $err = false; foreach( $mod_parser->actions as $action => $action_data ) { *************** *** 548,555 **** if ( !file_exists($mod_dir . $copy_files[$k]['from']) ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_copy', $mod_dir . $copy_files[$k]['from'], $copy_files[$k]['to']); } $copy_actions[] = 'copy ' . $copy_files[$k]['from'] . ' to ' . $copy_files[$k]['to']; } } display_mod_action('processed', $action, implode("\n", $copy_actions)); --- 609,623 ---- if ( !file_exists($mod_dir . $copy_files[$k]['from']) ) { ! em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_copy', $mod_dir . $copy_files[$k]['from']. ' -> ' . $copy_files[$k]['to']); ! $err = true; ! break; } $copy_actions[] = 'copy ' . $copy_files[$k]['from'] . ' to ' . $copy_files[$k]['to']; } + + if ( $err === true ) + { + break; + } } display_mod_action('processed', $action, implode("\n", $copy_actions)); *************** *** 562,565 **** --- 630,635 ---- { em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_open', $target_file); + $err = true; + break; } display_mod_action('processed', $action, $target_file); *************** *** 573,576 **** --- 643,648 ---- { em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_find', $actions_data['find'], $target_file); + $err = true; + break; } display_mod_action('processed', 'find', $actions_data['find']); *************** *** 600,603 **** --- 672,677 ---- { em_trigger_error(EM_ERR_CRITICAL, 'EM_Err_inline_find', $actions_data['find'], $target_file); + $err = true; + break; } display_mod_action('processed', 'in-line-find', $inlines_data['in-line-find']); *************** *** 618,621 **** --- 692,705 ---- } } + + if ( $err === true ) + { + break; + } + } + + if ( $err === true ) + { + break; } } *************** *** 641,648 **** } } } ! // temp ! display_mod_action('processed', 'mod-parser-class', var_export($mod_parser, true)); $hidden_ary = array( --- 725,739 ---- } } + + if ( $err === true ) + { + break; + } } ! if ( $err === false ) ! { ! $template->assign_block_vars('switch_next_step', array()); ! } $hidden_ary = array( *************** *** 677,681 **** redirect(append_sid("{$phpbb_root_path}admin/em_history.$phpEx")); } ! $step = request_var('step', 0); switch($step) --- 768,772 ---- redirect(append_sid("{$phpbb_root_path}admin/em_history.$phpEx")); } ! $step = request_var('step', 0); switch($step) *************** *** 810,813 **** --- 901,905 ---- // Show Page // + $template->assign_var_from_handle('EM_HEADER', 'em_head'); $template->pparse('body'); include('page_footer_admin.'.$phpEx); Index: em_history.php =================================================================== RCS file: /cvsroot/easymod/easymod/install/em_files/admin/em_history.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** em_history.php 9 Dec 2005 23:22:37 -0000 1.2 --- em_history.php 24 Dec 2005 01:43:42 -0000 1.3 *************** *** 1,8 **** <?php ! /** * * @package EasyMOD * @version $Id$ ! * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * --- 1,8 ---- <?php ! /** * * @package EasyMOD * @version $Id$ ! * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * *************** *** 32,36 **** $installed_mods = array(); $mods_count = 0; ! $sql = 'SELECT mod_id, mod_file, mod_install_time, mod_name, mod_version, mod_desc, mod_styles FROM ' . EM_MODS_TABLE . ' ORDER BY mod_install_time DESC'; --- 32,36 ---- $installed_mods = array(); $mods_count = 0; ! $sql = 'SELECT mod_id, mod_file, mod_install_time, mod_name, mod_version, mod_desc, mod_styles FROM ' . EM_MODS_TABLE . ' ORDER BY mod_install_time DESC'; *************** *** 98,101 **** --- 98,102 ---- // Show Page // + $template->assign_var_from_handle('EM_HEADER', 'em_head'); $template->pparse('body'); include('page_footer_admin.'.$phpEx); |