当前位置: 首页>>代码示例>>PHP>>正文


PHP pts_client::xsl_results_viewer_graph_template方法代码示例

本文整理汇总了PHP中pts_client::xsl_results_viewer_graph_template方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_client::xsl_results_viewer_graph_template方法的具体用法?PHP pts_client::xsl_results_viewer_graph_template怎么用?PHP pts_client::xsl_results_viewer_graph_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pts_client的用法示例。


在下文中一共展示了pts_client::xsl_results_viewer_graph_template方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generate_result_file_graphs

 public static function generate_result_file_graphs($test_results_identifier, $save_to_dir = false, $extra_attributes = null)
 {
     if ($save_to_dir) {
         if (pts_file_io::mkdir($save_to_dir . '/result-graphs') == false) {
             // Directory must exist, so remove any old graph files first
             foreach (pts_file_io::glob($save_to_dir . '/result-graphs/*') as $old_file) {
                 unlink($old_file);
             }
         }
     }
     if ($test_results_identifier instanceof pts_result_file) {
         $result_file =& $test_results_identifier;
     } else {
         $result_file = new pts_result_file($test_results_identifier);
     }
     $generated_graphs = array();
     $generated_graph_tables = false;
     // Render overview chart
     if ($save_to_dir) {
         $chart = new pts_ResultFileTable($result_file);
         $chart->renderChart($save_to_dir . '/result-graphs/overview.BILDE_EXTENSION');
         $intent = -1;
         if (($intent = pts_result_file_analyzer::analyze_result_file_intent($result_file, $intent, true)) || $result_file->get_system_count() == 1) {
             $chart = new pts_ResultFileCompactSystemsTable($result_file, $intent);
         } else {
             $chart = new pts_ResultFileSystemsTable($result_file);
         }
         $chart->renderChart($save_to_dir . '/result-graphs/systems.BILDE_EXTENSION');
         unset($chart);
         if ($intent && is_dir($save_to_dir . '/system-logs/')) {
             $chart = new pts_DetailedSystemComponentTable($result_file, $save_to_dir . '/system-logs/', $intent);
             if ($chart) {
                 $chart->renderChart($save_to_dir . '/result-graphs/detailed_component.BILDE_EXTENSION');
             }
         }
     }
     $result_objects = $result_file->get_result_objects();
     $test_titles = array();
     foreach ($result_objects as &$result_object) {
         array_push($test_titles, $result_object->test_profile->get_title());
     }
     $offset = 0;
     foreach ($result_objects as $key => &$result_object) {
         $save_to = $save_to_dir;
         $offset++;
         if ($save_to_dir && is_dir($save_to_dir)) {
             $save_to .= '/result-graphs/' . $offset . '.BILDE_EXTENSION';
             if (PTS_IS_CLIENT) {
                 if ($result_file->is_multi_way_comparison(null, $extra_attributes) || pts_client::read_env('GRAPH_GROUP_SIMILAR')) {
                     $table_keys = array();
                     foreach ($test_titles as $this_title_index => $this_title) {
                         if (isset($test_titles[$key]) && $this_title == $test_titles[$key]) {
                             array_push($table_keys, $this_title_index);
                         }
                     }
                 } else {
                     $table_keys = $key;
                 }
                 $chart = new pts_ResultFileTable($result_file, null, $table_keys);
                 $chart->renderChart($save_to_dir . '/result-graphs/' . $offset . '_table.BILDE_EXTENSION');
                 unset($chart);
                 $generated_graph_tables = true;
             }
         }
         $graph = pts_render::render_graph($result_object, $result_file, $save_to, $extra_attributes);
         array_push($generated_graphs, $graph);
     }
     // Generate mini / overview graphs
     if ($save_to_dir) {
         $graph = new pts_OverviewGraph($result_file);
         if ($graph->doSkipGraph() == false) {
             $graph->renderGraph();
             // Check to see if skip_graph was realized during the rendering process
             if ($graph->doSkipGraph() == false) {
                 $graph->svg_dom->output($save_to_dir . '/result-graphs/visualize.BILDE_EXTENSION');
             }
         }
         unset($graph);
         $graph = new pts_RadarOverviewGraph($result_file);
         if ($graph->doSkipGraph() == false) {
             $graph->renderGraph();
             // Check to see if skip_graph was realized during the rendering process
             if ($graph->doSkipGraph() == false) {
                 $graph->svg_dom->output($save_to_dir . '/result-graphs/radar.BILDE_EXTENSION');
             }
         }
         unset($graph);
     }
     // Save XSL
     if (count($generated_graphs) > 0 && $save_to_dir) {
         file_put_contents($save_to_dir . '/pts-results-viewer.xsl', pts_client::xsl_results_viewer_graph_template($generated_graph_tables));
     }
     return $generated_graphs;
 }
开发者ID:Grdflo,项目名称:phoronix-test-suite,代码行数:94,代码来源:pts_client.php


注:本文中的pts_client::xsl_results_viewer_graph_template方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。