summaryrefslogtreecommitdiffstats
path: root/pts-core
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-12-26 17:29:30 -0500
committerMichael Larabel <michael@phx-laptop.(none)>2008-12-26 17:29:30 -0500
commit015282cacb2033182de90a9c1e5a7979105fc536 (patch)
tree703d5e8937b03e6c74f4fd1041d88dd39342eb25 /pts-core
parentb5b270c8d249828f77d1d7d954aace31f2a6578f (diff)
downloadphoronix-test-suite-upstream-015282cacb2033182de90a9c1e5a7979105fc536.tar.gz
phoronix-test-suite-upstream-015282cacb2033182de90a9c1e5a7979105fc536.tar.xz
phoronix-test-suite-upstream-015282cacb2033182de90a9c1e5a7979105fc536.zip
pts_Graph: Allow the use of the SWF bilde_renderer through using the
SWF_DEBUG=1 environmental variable
Diffstat (limited to 'pts-core')
-rw-r--r--pts-core/functions/pts-functions_tests.php8
-rw-r--r--pts-core/objects/pts_Graph/pts_Graph.php20
2 files changed, 21 insertions, 7 deletions
diff --git a/pts-core/functions/pts-functions_tests.php b/pts-core/functions/pts-functions_tests.php
index 2f37c7d..0530cde 100644
--- a/pts-core/functions/pts-functions_tests.php
+++ b/pts-core/functions/pts-functions_tests.php
@@ -123,8 +123,6 @@ function pts_save_result($save_to = null, $save_results = null)
$t = new pts_BarGraph($results_name[$i], $results_attributes[$i], $results_scale[$i]);
}
- file_put_contents($save_to_dir . "/pts-results-viewer.xsl", pts_get_results_viewer_xsl_formatted($t->getRenderer()));
-
$t->loadGraphIdentifiers($results_identifiers[$i]);
$t->loadGraphValues($results_values[$i]);
$t->loadGraphRawValues($results_rawvalues[$i]);
@@ -137,6 +135,8 @@ function pts_save_result($save_to = null, $save_results = null)
$t->saveGraphToFile($save_to_dir . "/result-graphs/" . ($i + 1) . "." . strtolower($t->getRenderer()));
$t->renderGraph();
+
+ file_put_contents($save_to_dir . "/pts-results-viewer.xsl", pts_get_results_viewer_xsl_formatted($t->getRenderer(), $t->graphWidth(), $t->graphHeight()));
}
}
$bool = file_put_contents(SAVE_RESULTS_DIR . $save_to, $save_results);
@@ -211,7 +211,7 @@ function pts_subsystem_test_types()
{
return array("System", "Processor", "Disk", "Graphics", "Memory", "Network");
}
-function pts_get_results_viewer_xsl_formatted($format_type = "PNG")
+function pts_get_results_viewer_xsl_formatted($format_type = "PNG", $width, $height)
{
$raw_xsl = file_get_contents(RESULTS_VIEWER_DIR . "pts-results-viewer.xsl");
@@ -221,7 +221,7 @@ function pts_get_results_viewer_xsl_formatted($format_type = "PNG")
}
else if($format_type == "SWF")
{
- $graph_string = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" id=\"objects\" width=\"580\" height=\"500\"><param name=\"movie\"><xsl:attribute name=\"value\">result-graphs/<xsl:number value=\"position()\" />.swf</xsl:attribute></param><embed width=\"580\" height=\"500\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"><xsl:attribute name=\"src\">result-graphs/<xsl:number value=\"position()\" />.swf</xsl:attribute></embed></object>";
+ $graph_string = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" id=\"objects\" width=\"" . $width . "\" height=\"" . $height . "\"><param name=\"movie\"><xsl:attribute name=\"value\">result-graphs/<xsl:number value=\"position()\" />.swf</xsl:attribute></param><embed width=\"" . $width . "\" height=\"" . $height . "\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"><xsl:attribute name=\"src\">result-graphs/<xsl:number value=\"position()\" />.swf</xsl:attribute></embed></object>";
}
else
{
diff --git a/pts-core/objects/pts_Graph/pts_Graph.php b/pts-core/objects/pts_Graph/pts_Graph.php
index dd4222d..c152511 100644
--- a/pts-core/objects/pts_Graph/pts_Graph.php
+++ b/pts-core/objects/pts_Graph/pts_Graph.php
@@ -110,7 +110,8 @@ abstract class pts_Graph
putenv("GDFONTPATH=" . getcwd());
}
- // Set a renderer
+ // Determine renderers available
+ $ming_available = extension_loaded("ming");
if(!extension_loaded("gd"))
{
/* if(dl("gd.so"))
@@ -124,8 +125,13 @@ abstract class pts_Graph
{
$gd_available = true;
}
-
- if($gd_available && getenv("SVG_DEBUG") == false)
+
+ // Set a renderer
+ if($ming_available && getenv("SWF_DEBUG") != false)
+ {
+ $this->setRenderer("SWF");
+ }
+ else if($gd_available && getenv("SVG_DEBUG") == false)
{
$this->setRenderer("PNG");
}
@@ -260,6 +266,14 @@ abstract class pts_Graph
{
$this->graph_output = $file;
}
+ public function graphWidth()
+ {
+ return $this->graph_attr_width;
+ }
+ public function graphHeight()
+ {
+ return $this->graph_attr_height;
+ }
//
// Misc Functions