2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
41 require_once( 'include/utils/progress_bar_utils.php' );
42 require_once( 'include/utils/zip_utils.php' );
46 global $skip_md5_diff;
47 $skip_md5_diff = false;
50 // get all needed globals
52 global $app_list_strings;
61 $db = DBManagerFactory::getInstance();
65 if(!is_admin($current_user)){
66 die($mod_strings['LBL_DIAGNOSTIC_ACCESS']);
73 //get sugar version and flavor
74 global $sugar_version;
78 //guid used for directory path
80 $sod_guid = create_guid();
82 //GET CURRENT DATETIME STAMP TO USE IN FILENAME
84 $curdatetime = date("Ymd-His");
87 global $progress_bar_percent;
88 $progress_bar_percent = 0;
95 define("CONFIG_WEIGHT", 1);
96 define("CUSTOM_DIR_WEIGHT", 1);
97 define("PHPINFO_WEIGHT", 1);
98 define("MYSQL_DUMPS_WEIGHT", 2);
99 define("MYSQL_SCHEMA_WEIGHT", 3);
100 define("MYSQL_INFO_WEIGHT", 1);
101 define("MD5_WEIGHT", 5);
102 define("BEANLISTBEANFILES_WEIGHT", 1);
103 define("SUGARLOG_WEIGHT", 2);
104 define("VARDEFS_WEIGHT", 2);
106 //THIS MUST CHANGE IF THE NUMBER OF DIRECTORIES TRAVERSED TO GET TO
107 // THE DIAGNOSTIC CACHE DIR CHANGES
108 define("RETURN_FROM_DIAG_DIR", "../../../..");
110 global $getDumpsFrom;
111 $getDumpsFrom = Array();
116 function sodUpdateProgressBar($itemweight){
117 global $progress_bar_percent;
120 global $currentitems;
123 if($currentitems == $totalitems)
124 update_progress_bar("diagnostic", 100, 100);
127 $progress_bar_percent += ($itemweight / $GLOBALS['totalweight'] * 100);
128 update_progress_bar("diagnostic", $progress_bar_percent, 100);
133 // expects a string containing the name of the table you would like to get the dump of
134 // expects there to already be a connection to mysql and the 'use database_name' to be done
135 // returns a string containing (in html) the dump of all rows
136 function getFullTableDump($tableName){
140 $returnString = "<table border=\"1\">";
141 $returnString .= "<tr><b><center>Table ".$tableName."</center></b></tr>";
142 //get table field definitions
143 $definitions = array();
144 $def_result = $db->query("describe ".$tableName);
147 return mysql_error();
151 $returnString .= "<tr><td><b>Row Num</b></td>";
153 while($row = $db->fetchByAssoc($def_result))
155 $row = array_values($row);
156 $definitions[$def_count] = $row[0];
158 $returnString .= "<td><b>".$row[0]."</b></td>";
160 $returnString .= "</tr>";
163 $td_result = $db->query("select * from ".$tableName);
166 return mysql_error();
171 while($row = $db->fetchByAssoc($td_result))
173 $row = array_values($row);
174 $returnString .= "<tr>";
175 $returnString .= "<td>".$row_counter."</td>";
176 for($counter = 0; $counter < $def_count; $counter++){
178 $replace_val = false;
179 //perform this check when counter is set to two, which means it is on the 'value' column
181 //if the previous "name" column value was set to smtppass, set replace_val to true
182 if(strcmp($row[$counter - 1], "smtppass") == 0 )
185 //if the previous "name" column value was set to smtppass,
186 //and the "category" value set to ldap, set replace_val to true
187 if (strcmp($row[$counter - 2], "ldap") == 0 && strcmp($row[$counter - 1], "admin_password") == 0)
190 //if the previous "name" column value was set to password,
191 //and the "category" value set to proxy, set replace_val to true
192 if(strcmp($row[$counter - 2], "proxy") == 0 && strcmp($row[$counter - 1], "password") == 0 )
197 $returnString .= "<td>********</td>";
199 $returnString .= "<td>".($row[$counter] == "" ? " " : $row[$counter])."</td>";
202 $returnString .= "</tr>";
205 $returnString .= "</table>";
207 return $returnString;
211 // Deletes the directory recursively
212 function deleteDir($dir)
214 if (substr($dir, strlen($dir)-1, 1) != '/')
217 if ($handle = opendir($dir))
219 while ($obj = readdir($handle))
221 if ($obj != '.' && $obj != '..')
223 if (is_dir($dir.$obj))
225 if (!deleteDir($dir.$obj))
228 elseif (is_file($dir.$obj))
230 if (!unlink($dir.$obj))
246 function prepareDiag()
248 global $getDumpsFrom;
251 global $progress_bar_percent;
252 global $skip_md5_diff;
256 echo getClassicModuleTitle(
259 "<a href='index.php?module=Administration&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>",
260 translate('LBL_DIAGNOSTIC_TITLE')
265 echo $mod_strings['LBL_DIAGNOSTIC_EXECUTING'];
269 //determine if files.md5 exists or not
270 if(file_exists('files.md5'))
271 $skip_md5_diff = false;
273 $skip_md5_diff = true;
275 // array of all tables that we need to pull rows from below
276 $getDumpsFrom = array('config' => 'config',
277 'fields_meta_data' => 'fields_meta_data',
278 'upgrade_history' => 'upgrade_history',
279 'versions' => 'versions',
283 //Creates the diagnostic directory in the cache directory
284 $cacheDir = create_cache_directory("diagnostic/");
285 $cacheDir = create_cache_directory("diagnostic/".$sod_guid);
286 $cacheDir = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/");
288 display_progress_bar("diagnostic", $progress_bar_percent, 100);
293 function executesugarlog()
295 //BEGIN COPY SUGARCRM.LOG
296 //Copies the Sugarcrm log to our diagnostic directory
298 require_once('include/SugarLogger/SugarLogger.php');
299 $logger = new SugarLogger();
300 if(!copy($logger->getLogFileNameWithPath(), $cacheDir.'/'.$logger->getLogFileName())) {
301 echo "Couldn't copy sugarcrm.log to cacheDir.<br>";
303 //END COPY SUGARCRM.LOG
305 //UPDATING PROGRESS BAR
306 sodUpdateProgressBar(SUGARLOG_WEIGHT);
309 function executephpinfo()
312 //This gets phpinfo, writes to a buffer, then I write to phpinfo.html
317 $phpinfo = ob_get_contents();
320 $handle = sugar_fopen($cacheDir."phpinfo.html", "w");
321 if(fwrite($handle, $phpinfo) === FALSE){
322 echo "Cannot write to file ".$cacheDir."phpinfo.html<br>";
327 //UPDATING PROGRESS BAR
328 sodUpdateProgressBar(PHPINFO_WEIGHT);
331 function executeconfigphp()
333 //BEGIN COPY CONFIG.PHP
334 //store db_password in temp var so we can get config.php w/o making anyone angry
335 global $cacheDir; global $sugar_config;
337 $tempPass = $sugar_config['dbconfig']['db_password'];
338 $sugar_config['dbconfig']['db_password'] = '********';
339 //write config.php to a file
340 write_array_to_file("Diagnostic", $sugar_config, $cacheDir."config.php");
341 //restore db_password so everything still works
342 $sugar_config['dbconfig']['db_password'] = $tempPass;
343 //END COPY CONFIG.PHP
345 //UPDATING PROGRESS BAR
346 sodUpdateProgressBar(CONFIG_WEIGHT);
349 function executemysql($getinfo, $getdumps, $getschema)
352 global $getDumpsFrom;
354 global $sugar_config;
355 global $progress_bar_percent;
359 if($db->dbType != "mysql") {
360 if($getinfo) sodUpdateProgressBar(MYSQL_INFO_WEIGHT);
361 if($getschema) sodUpdateProgressBar(MYSQL_SCHEMA_WEIGHT);
362 if($getdumps) sodUpdateProgressBar(MYSQL_DUMPS_WEIGHT);
366 $mysqlInfoDir = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/MySQL/");
369 //create directory for table definitions
371 $tablesSchemaDir = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/MySQL/TableSchema/");
373 //BEGIN GET MYSQL INFO
374 //make sure they checked the box to get basic info
378 echo "MySQL Version: ".(function_exists('mysqli_get_client_info') ? @mysqli_get_client_info() : @mysql_get_client_info())."<BR>";
379 echo "MySQL Host Info: ".(function_exists('mysqli_get_host_info') ? @mysqli_get_host_info($db->getDatabase()) : @mysql_get_host_info())."<BR>";
380 echo "MySQL Server Info: ".(function_exists('mysqli_get_client_info') ? @mysqli_get_client_info() : @mysql_get_client_info())."<BR>";
381 echo "MySQL Client Encoding: ".(function_exists('mysqli_character_set_name') ? @mysqli_character_set_name($db->getDatabase()) : @mysql_client_encoding())."<BR>";
383 /* Uncomment to get current processes as well
384 echo "<BR>MySQL Processes<BR>";
385 $res = $db->query('SHOW PROCESSLIST');
386 echo "<table border=\"1\"><tr><th>Id</th><th>Host</th><th>db</th><th>Command</th><th>Time</th></tr>";
387 if($db->getRowCount($res) > 0)
389 while($row = $db->fetchByAssoc($res))
391 printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
392 $row['Id'], $row['Host'], $row['db'], $row['Command'], $row['Time']
400 echo "No processes running<br>";
404 echo "<BR>MySQL Character Set Settings<BR>";
405 $res = $db->query("show variables like 'character\_set\_%'");
406 echo "<table border=\"1\"><tr><th>Variable Name</th><th>Value</th></tr>";
407 while($row = $db->fetchByAssoc($res))
409 printf("<tr><td>%s</td><td>%s</td></tr>",
410 $row['Variable_name'], $row['Value']
415 $content = ob_get_contents();
418 $handle = sugar_fopen($mysqlInfoDir."MySQL-General-info.html", "w");
419 if(fwrite($handle, $content) === FALSE){
420 echo "Cannot write to file ".$mysqlInfoDir."_MySQL-General-info.html<br>";
423 //BEGIN UPDATING PROGRESS BAR
424 sodUpdateProgressBar(MYSQL_INFO_WEIGHT);
425 //END UPDATING PROGRESS BAR
432 //BEGIN GET ALL TABLES SCHEMAS
433 $all_tables = $db->getTablesArray();
439 echo file_get_contents($theme_path."style.css");
441 foreach($all_tables as $tablename){
442 //setting up table header for each file
443 echo "<table border=\"0\" cellpadding=\"0\" class=\"tabDetailView\">";
444 echo "<tr>MySQL ".$tablename." Definitions:</tr>".
445 "<tr><td class=\"tabDetailViewDL\"><b>Field</b></td>".
446 "<td class=\"tabDetailViewDL\">Type</td>".
447 "<td class=\"tabDetailViewDL\">Null</td>".
448 "<td class=\"tabDetailViewDL\">Key</td>".
449 "<td class=\"tabDetailViewDL\">Default</td>".
450 "<td class=\"tabDetailViewDL\">Extra</td></tr>";
451 $describe = $db->query("describe ".$tablename);
452 while($inner_row = $db->fetchByAssoc($describe)){
453 $inner_row = array_values($inner_row);
454 echo "<tr><td class=\"tabDetailViewDF\"><b>".$inner_row[0]."</b></td>";
455 echo "<td class=\"tabDetailViewDF\">".$inner_row[1]."</td>";
456 echo "<td class=\"tabDetailViewDF\">".$inner_row[2]."</td>";
457 echo "<td class=\"tabDetailViewDF\">".$inner_row[3]."</td>";
458 echo "<td class=\"tabDetailViewDF\">".$inner_row[4]."</td>";
459 echo "<td class=\"tabDetailViewDF\">".$inner_row[5]."</td></tr>";
465 $content = ob_get_contents();
468 $handle = sugar_fopen($tablesSchemaDir."MySQLTablesSchema.html", "w");
469 if(fwrite($handle, $content) === FALSE){
470 echo "Cannot write to file ".$tablesSchemaDir."MySQLTablesSchema.html<br>";
474 //END GET ALL TABLES SCHEMAS
475 //BEGIN UPDATING PROGRESS BAR
476 sodUpdateProgressBar(MYSQL_SCHEMA_WEIGHT);
477 //END UPDATING PROGRESS BAR
482 //BEGIN GET TABLEDUMPS
483 $tableDumpsDir = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/MySQL/TableDumps/");
486 foreach ($getDumpsFrom as $table)
489 //calling function defined above to get the string for dump
490 echo getFullTableDump($table);
491 $content = ob_get_contents();
493 $handle = sugar_fopen($tableDumpsDir.$table.".html", "w");
494 if(fwrite($handle, $content) === FALSE){
495 echo "Cannot write to file ".$tableDumpsDir.$table."html<br>";
500 //BEGIN UPDATING PROGRESS BAR
501 sodUpdateProgressBar(MYSQL_DUMPS_WEIGHT);
502 //END UPDATING PROGRESS BAR
510 function executebeanlistbeanfiles()
512 //BEGIN CHECK BEANLIST FILES ARE AVAILABLE
520 echo $mod_strings['LBL_DIAGNOSTIC_BEANLIST_DESC'];
522 echo "<font color=green>";
523 echo $mod_strings['LBL_DIAGNOSTIC_BEANLIST_GREEN'];
526 echo "<font color=orange>";
527 echo $mod_strings['LBL_DIAGNOSTIC_BEANLIST_ORANGE'];
530 echo "<font color=red>";
531 echo $mod_strings['LBL_DIAGNOSTIC_BEANLIST_RED'];
535 foreach ($beanList as $beanz)
537 if(!isset($beanFiles[$beanz]))
539 echo "<font color=orange>NO! --- ".$beanz." is not an index in \$beanFiles</font><br>";
543 if(file_exists($beanFiles[$beanz]))
544 echo "<font color=green>YES --- ".$beanz." file \"".$beanFiles[$beanz]."\" exists</font><br>";
546 echo "<font color=red>NO! --- ".$beanz." file \"".$beanFiles[$beanz]."\" does NOT exist</font><br>";
550 $content = ob_get_contents();
553 $handle = sugar_fopen($cacheDir."beanFiles.html", "w");
554 if(fwrite($handle, $content) === FALSE){
555 echo "Cannot write to file ".$cacheDir."beanFiles.html<br>";
558 //END CHECK BEANLIST FILES ARE AVAILABLE
559 //BEGIN UPDATING PROGRESS BAR
560 sodUpdateProgressBar(BEANLISTBEANFILES_WEIGHT);
561 //END UPDATING PROGRESS BAR
564 function executecustom_dir()
566 //BEGIN ZIP AND SAVE CUSTOM DIRECTORY
569 zip_dir("custom", $cacheDir."custom_directory.zip");
570 //END ZIP AND SAVE CUSTOM DIRECTORY
571 //BEGIN UPDATING PROGRESS BAR
572 sodUpdateProgressBar(CUSTOM_DIR_WEIGHT);
573 //END UPDATING PROGRESS BAR
576 function executemd5($filesmd5, $md5calculated)
578 //BEGIN ALL MD5 CHECKS
580 global $skip_md5_diff;
582 if(file_exists('files.md5'))
583 include( 'files.md5');
584 //create dir for md5s
585 $md5_directory = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/md5/");
587 //skip this if the files.md5 didn't exist
590 //make sure the files.md5
592 if(!copy('files.md5', $md5_directory."files.md5"))
593 echo "Couldn't copy files.md5 to ".$md5_directory."<br>Skipping md5 checks.<br>";
596 $md5_string_calculated = generateMD5array('./');
599 write_array_to_file('md5_string_calculated', $md5_string_calculated, $md5_directory."md5_array_calculated.php");
602 //if the files.md5 didn't exist, we can't do this
605 $md5_string_diff = array_diff($md5_string_calculated, $md5_string);
607 write_array_to_file('md5_string_diff', $md5_string_diff, $md5_directory."md5_array_diff.php");
610 //BEGIN UPDATING PROGRESS BAR
611 sodUpdateProgressBar(MD5_WEIGHT);
612 //END UPDATING PROGRESS BAR
615 function executevardefs()
617 //BEGIN DUMP OF SUGAR SCHEMA (VARDEFS)
619 //END DUMP OF SUGAR SCHEMA (VARDEFS)
620 //BEGIN UPDATING PROGRESS BAR
621 //This gets the vardefs, writes to a buffer, then I write to vardefschema.html
626 global $sugar_version;
627 global $sugar_db_version;
628 global $sugar_flavor;
631 foreach ( $beanList as $beanz ) {
632 // echo "Module: ".$beanz."<br>";
634 $path_parts = pathinfo( $beanFiles[ $beanz ] );
635 $vardefFileName = $path_parts[ 'dirname' ]."/vardefs.php";
636 if( file_exists( $vardefFileName )) {
637 // echo "<br>".$vardefFileName."<br>";
638 include_once( $vardefFileName );
644 echo "<H1>Schema listing based on vardefs</H1>";
645 echo "<P>Sugar version: ".$sugar_version." / Sugar DB version: ".$sugar_db_version." / Sugar flavor: ".$sugar_flavor;
648 echo "<style> th { text-align: left; } </style>";
651 foreach($dictionary as $vardef) {
652 $tables[] = $vardef['table'];
653 $fields[$vardef['table']] = $vardef['fields'];
654 $comments[$vardef['table']] = $vardef['comment'];
659 foreach($tables as $t) {
661 if ( $name == "does_not_exist" )
663 $comment = $comments[$t];
664 echo "<h2>Table: $t</h2>
665 <p><i>{$comment}</i></p>";
666 echo "<table border=\"0\" cellpadding=\"3\" class=\"tabDetailView\">";
667 echo '<TR BGCOLOR="#DFDFDF">
668 <TD NOWRAP ALIGN=left class=\"tabDetailViewDL\">Column</TD>
669 <TD NOWRAP class=\"tabDetailViewDL\">Type</TD>
670 <TD NOWRAP class=\"tabDetailViewDL\">Length</TD>
671 <TD NOWRAP class=\"tabDetailViewDL\">Required</TD>
672 <TD NOWRAP class=\"tabDetailViewDL\">Comment</TD>
675 ksort( $fields[ $t ] );
677 foreach($fields[$t] as $k => $v) {
678 // we only care about physical tables ('source' can be 'non-db' or 'nondb' or 'function' )
679 if ( isset( $v[ 'source' ] ))
681 $columnname = $v[ 'name' ];
682 $columntype = $v[ 'type' ];
683 $columndbtype = $v[ 'dbType' ];
684 $columnlen = $v[ 'len' ];
685 $columncomment = $v[ 'comment' ];
686 $columnrequired = $v[ 'required' ];
688 if ( empty( $columnlen ) ) $columnlen = '<i>n/a</i>';
689 if ( empty( $columncomment ) ) $columncomment = '<i>(none)</i>';
690 if ( !empty( $columndbtype ) ) $columntype = $columndbtype;
691 if ( empty( $columnrequired ) || ( $columnrequired == false ))
692 $columndisplayrequired = 'no';
694 $columndisplayrequired = 'yes';
696 echo '<TR BGCOLOR="#FFFFFF" ALIGN=left>
697 <TD ALIGN=left class=\"tabDetailViewDF\">'.$columnname.'</TD>
698 <TD NOWRAP class=\"tabDetailViewDF\">'.$columntype.'</TD>
699 <TD NOWRAP class=\"tabDetailViewDF\">'.$columnlen.'</TD>
700 <TD NOWRAP class=\"tabDetailViewDF"\">'.$columndisplayrequired.'</TD>
701 <TD WRAP class=\"tabDetailViewDF\">'.$columncomment.'</TD></TR>';
707 echo "</body></html>";
709 $vardefFormattedOutput = ob_get_contents();
712 $handle = sugar_fopen($cacheDir."vardefschema.html", "w");
713 if(fwrite($handle, $vardefFormattedOutput) === FALSE){
714 echo "Cannot write to file ".$cacheDir."vardefschema.html<br>";
717 sodUpdateProgressBar(VARDEFS_WEIGHT);
718 //END UPDATING PROGRESS BAR
721 function finishDiag(){
722 //BEGIN ZIP ALL FILES AND EXTRACT IN CACHE ROOT
729 zip_dir(".", "../diagnostic".$curdatetime.".zip");
730 //END ZIP ALL FILES AND EXTRACT IN CACHE ROOT
731 chdir(RETURN_FROM_DIAG_DIR);
733 deleteDir($cacheDir);
735 print "<a href=\"{$GLOBALS['sugar_config']['cache_dir']}diagnostic/".$sod_guid."/diagnostic".$curdatetime.".zip\">".$mod_strings['LBL_DIAGNOSTIC_DOWNLOADLINK']."</a><BR>";
737 print "<a href=\"index.php?module=Administration&action=DiagnosticDelete&file=diagnostic".$curdatetime."&guid=".$sod_guid."\">".$mod_strings['LBL_DIAGNOSTIC_DELETELINK']."</a><br>";
741 //BEGIN check for what we are executing
742 $doconfigphp = ((empty($_POST['configphp']) || $_POST['configphp'] == 'off') ? false : true);
743 $docustom_dir = ((empty($_POST['custom_dir']) || $_POST['custom_dir'] == 'off') ? false : true);
744 $dophpinfo = ((empty($_POST['phpinfo']) || $_POST['phpinfo'] == 'off') ? false : true);
745 $domysql_dumps = ((empty($_POST['mysql_dumps']) || $_POST['mysql_dumps'] == 'off') ? false : true);
746 $domysql_schema = ((empty($_POST['mysql_schema']) || $_POST['mysql_schema'] == 'off') ? false : true);
747 $domysql_info = ((empty($_POST['mysql_info']) || $_POST['mysql_info'] == 'off') ? false : true);
748 $domd5 = ((empty($_POST['md5']) || $_POST['md5'] == 'off') ? false : true);
749 $domd5filesmd5 = ((empty($_POST['md5filesmd5']) || $_POST['md5filesmd5'] == 'off') ? false : true);
750 $domd5calculated = ((empty($_POST['md5calculated']) || $_POST['md5calculated'] == 'off') ? false : true);
751 $dobeanlistbeanfiles = ((empty($_POST['beanlistbeanfiles']) || $_POST['beanlistbeanfiles'] == 'off') ? false : true);
752 $dosugarlog = ((empty($_POST['sugarlog']) || $_POST['sugarlog'] == 'off') ? false : true);
753 $dovardefs = ((empty($_POST['vardefs']) || $_POST['vardefs'] == 'off') ? false : true);
754 //END check for what we are executing
757 //BEGIN items to calculate progress bar
760 if($doconfigphp) {$totalweight += CONFIG_WEIGHT; $totalitems++;}
761 if($docustom_dir) {$totalweight += CUSTOM_DIR_WEIGHT; $totalitems++;}
762 if($dophpinfo) {$totalweight += PHPINFO_WEIGHT; $totalitems++;}
763 if($domysql_dumps) {$totalweight += MYSQL_DUMPS_WEIGHT; $totalitems++;}
764 if($domysql_schema) {$totalweight += MYSQL_SCHEMA_WEIGHT; $totalitems++;}
765 if($domysql_info) {$totalweight += MYSQL_INFO_WEIGHT; $totalitems++;}
766 if($domd5) {$totalweight += MD5_WEIGHT; $totalitems++;}
767 if($dobeanlistbeanfiles) {$totalweight += BEANLISTBEANFILES_WEIGHT; $totalitems++;}
768 if($dosugarlog) {$totalweight += SUGARLOG_WEIGHT; $totalitems++;}
769 if($dovardefs) {$totalweight += VARDEFS_WEIGHT; $totalitems++;}
770 //END items to calculate progress bar
772 //prepare initial steps
778 echo $mod_strings['LBL_DIAGNOSTIC_GETCONFPHP']."<BR>";
780 echo $mod_strings['LBL_DIAGNOSTIC_DONE']."<BR><BR>";
784 echo $mod_strings['LBL_DIAGNOSTIC_GETCUSTDIR']."<BR>";
786 echo $mod_strings['LBL_DIAGNOSTIC_DONE']."<BR><BR>";
790 echo $mod_strings['LBL_DIAGNOSTIC_GETPHPINFO']."<BR>";
792 echo $mod_strings['LBL_DIAGNOSTIC_DONE']."<BR><BR>";
794 if($domysql_info || $domysql_dumps || $domysql_schema)
796 echo $mod_strings['LBL_DIAGNOSTIC_GETTING'].
797 ($domysql_info ? "... ".$mod_strings['LBL_DIAGNOSTIC_GETMYSQLINFO'] : " ").
798 ($domysql_dumps ? "... ".$mod_strings['LBL_DIAGNOSTIC_GETMYSQLTD'] : " ").
799 ($domysql_schema ? "... ".$mod_strings['LBL_DIAGNOSTIC_GETMYSQLTS'] : "...").
801 executemysql($domysql_info, $domysql_dumps, $domysql_schema);
802 echo $mod_strings['LBL_DIAGNOSTIC_DONE']."<BR><BR>";
806 echo $mod_strings['LBL_DIAGNOSTIC_GETMD5INFO']."<BR>";
807 executemd5($domd5filesmd5, $domd5calculated);
808 echo $mod_strings['LBL_DIAGNOSTIC_DONE']."<BR><BR>";
810 if($dobeanlistbeanfiles)
812 echo $mod_strings['LBL_DIAGNOSTIC_GETBEANFILES']."<BR>";
813 executebeanlistbeanfiles();
814 echo $mod_strings['LBL_DIAGNOSTIC_DONE']."<BR><BR>";
818 echo $mod_strings['LBL_DIAGNOSTIC_GETSUGARLOG']."<BR>";
820 echo $mod_strings['LBL_DIAGNOSTIC_DONE']."<BR><BR>";
824 echo $mod_strings['LBL_DIAGNOSTIC_VARDEFS']."<BR>";
826 echo $mod_strings['LBL_DIAGNOSTIC_DONE']."<BR><BR>";
829 //finish up the last steps