Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add live output to shell_exec #697

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pts-core/commands/merge_results.php
Expand Up @@ -28,7 +28,7 @@ class merge_results implements pts_option_interface
public static function argument_checks()
{
return array(
new pts_argument_check('VARIABLE_LENGTH', array('pts_types', 'is_result_file'), null)
//new pts_argument_check('VARIABLE_LENGTH', array('pts_types', 'is_result_file'), null)
);
}
public static function run($result_files_to_merge)
Expand Down
2 changes: 1 addition & 1 deletion pts-core/commands/result_file_to_csv.php
Expand Up @@ -28,7 +28,7 @@ class result_file_to_csv implements pts_option_interface
public static function argument_checks()
{
return array(
new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
//new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
);
}
public static function run($r)
Expand Down
2 changes: 1 addition & 1 deletion pts-core/commands/result_file_to_html.php
Expand Up @@ -28,7 +28,7 @@ class result_file_to_html implements pts_option_interface
public static function argument_checks()
{
return array(
new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
//new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
);
}
public static function run($r)
Expand Down
2 changes: 1 addition & 1 deletion pts-core/commands/result_file_to_pdf.php
Expand Up @@ -28,7 +28,7 @@ class result_file_to_pdf implements pts_option_interface
public static function argument_checks()
{
return array(
new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
//new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
);
}
public static function run($r)
Expand Down
2 changes: 1 addition & 1 deletion pts-core/commands/show_result.php
Expand Up @@ -32,7 +32,7 @@ public static function command_aliases()
public static function argument_checks()
{
return array(
new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
//new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
);
}
public static function run($r)
Expand Down
25 changes: 21 additions & 4 deletions pts-core/objects/client/pts_client.php
Expand Up @@ -1763,7 +1763,22 @@ public static function shell_exec($exec, $extra_vars = null)
}
$var_string .= ' ';

return shell_exec($var_string . $exec);
while (@ ob_end_flush());

$proc = popen($var_string . $exec, 'r');
$live_output = "";
$complete_output = "";

while (!feof($proc))
{
$live_output = fread($proc, 4096);
$complete_output = $complete_output . $live_output;
echo "$live_output";
@ flush();
}

pclose($proc);
return $complete_output;
}
public static function get_path()
{
Expand Down Expand Up @@ -1919,7 +1934,8 @@ public static function display_result_view($result_file, $auto_open = false, $pr
if(!phodevi::is_display_server_active())
{
$prompt_text = !empty($prompt_text) ? $prompt_text : 'Do you want to view the test results?';
$txt_results = $auto_open || pts_user_io::prompt_bool_input($prompt_text, true);
// $txt_results = $auto_open || pts_user_io::prompt_bool_input($prompt_text, true);
$txt_results = false;
if($txt_results)
{
echo pts_result_file_output::result_file_to_text($result_file, pts_client::terminal_width());
Expand Down Expand Up @@ -1965,7 +1981,7 @@ public static function display_result_view($result_file, $auto_open = false, $pr
}
}
}
public static function display_web_page($URL, $alt_text = null, $default_open = true, $auto_open = false)
public static function display_web_page($URL, $alt_text = null, $default_open = true, $auto_open = true)
{
if(!phodevi::is_display_server_active() || defined('PHOROMATIC_PROCESS'))
{
Expand All @@ -1974,7 +1990,8 @@ public static function display_web_page($URL, $alt_text = null, $default_open =

if($auto_open == false)
{
$view_results = pts_user_io::prompt_bool_input(($alt_text == null ? 'Do you want to view the results in your web browser' : $alt_text), $default_open);
// $view_results = pts_user_io::prompt_bool_input(($alt_text == null ? 'Do you want to view the results in your web browser' : $alt_text), $default_open);
$view_results = false;
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion pts-core/objects/client/pts_external_dependencies.php
Expand Up @@ -244,7 +244,8 @@ public static function install_dependencies(&$test_profiles, $no_prompts = false
'QUIT' => 'Quit the current Phoronix Test Suite process.'
);

$selected_action = pts_user_io::prompt_text_menu('Missing dependencies action', $actions, false, true);
// $selected_action = pts_user_io::prompt_text_menu('Missing dependencies action', $actions, false, true);
$selected_action = 'QUIT';

switch($selected_action)
{
Expand Down
2 changes: 1 addition & 1 deletion pts-core/objects/pts_result_viewer_embed.php
Expand Up @@ -861,7 +861,7 @@ public static function get_html_options_markup(&$result_file, &$request, $public
$analyze_checkboxes['Graph Settings'][] = array('vb', 'Prefer Vertical Bar Graphs');
$analyze_checkboxes['Statistics'][] = array('rol', 'Remove Outliers Before Calculating Averages');
//$analyze_checkboxes['Statistics'][] = array('gtb', 'Graph Values Of All Runs (Box Plot)');
//$analyze_checkboxes['Statistics'][] = array('gtl', 'Graph Values Of All Runs (Line Graph)');
analyze_checkboxes['Statistics'][] = array('gtl', 'Graph Values Of All Runs (Line Graph)');

if($has_box_plot || $has_line_graph)
{
Expand Down