diff --git a/lib/xhprof/readme_moodle.txt b/lib/xhprof/readme_moodle.txt index 6168abd7b7f..f732a368f5b 100644 --- a/lib/xhprof/readme_moodle.txt +++ b/lib/xhprof/readme_moodle.txt @@ -1,17 +1,19 @@ Description of XHProf 0.9.2 library/viewer import into Moodle -Removed: +Removed (commit #1): + * .arcconfig - Definitions for arcanist/phabricator removed completely + * composer.json - Composer's definition removed completely * examples - examples dir removed completely * extension - extension dir removed completely * package.xml - PECL package definition removed completely * xhprof_html/docs - documentation dir removed completely -Added: +Added (commit #2 - always taken from current moodle.git master): * index.html - prevent directory browsing on misconfigured servers * xhprof_moodle.php - containing all the stuff needed to run the xhprof profiler within Moodle * readme_moodle.txt - this file ;-) -Our changes: Look for "moodle" in code +Our changes: Look for "moodle" in code (commit #3 - always mimic from current moodle.git master): * xhprof_html/index.php ----| * xhprof_html/callgraph.php -|=> Changed to use own DB iXHProfRuns implementation (moodle_xhprofrun) * xhprof_html/typeahead.php -| diff --git a/lib/xhprof/xhprof_html/callgraph.php b/lib/xhprof/xhprof_html/callgraph.php index 9f7acabac0e..a315dbcefdf 100644 --- a/lib/xhprof/xhprof_html/callgraph.php +++ b/lib/xhprof/xhprof_html/callgraph.php @@ -29,12 +29,12 @@ * @author Changhao Jiang (cjiang@facebook.com) */ -// start moodle modification: moodleize this script +// Start moodle modification: moodleize this script. require_once(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php'); require_once($CFG->libdir . '/xhprof/xhprof_moodle.php'); require_login(); require_capability('moodle/site:config', context_system::instance()); -// end moodle modification +// End moodle modification. // by default assume that xhprof_html & xhprof_lib directories // are at the same level. @@ -85,11 +85,10 @@ if (!array_key_exists($type, $xhprof_legal_image_types)) { $type = $params['type'][1]; // default image type. } -// start moodle modification: use own XHProfRuns implementation -//$xhprof_runs_impl = new XHProfRuns_Default(); -require_once($GLOBALS['XHPROF_LIB_ROOT'].'/../xhprof_moodle.php'); +// Start moodle modification: use own XHProfRuns implementation. +// $xhprof_runs_impl = new XHProfRuns_Default(); $xhprof_runs_impl = new moodle_xhprofrun(); -// end moodle modification +// End moodle modification. if (!empty($run)) { // single run call graph image generation diff --git a/lib/xhprof/xhprof_html/css/xhprof.css b/lib/xhprof/xhprof_html/css/xhprof.css index 712fc7754b9..fc727d9d789 100644 --- a/lib/xhprof/xhprof_html/css/xhprof.css +++ b/lib/xhprof/xhprof_html/css/xhprof.css @@ -13,13 +13,11 @@ * limitations under the License. */ -/* start moodle modification: add basic, smaller, font specs */ +/* Start moodle modification: add basic, smaller, font specs */ body, p, table, li { - font: normal normal normal 13px/1.231 arial, helvetica, clean, sans-serif; + font: normal normal normal 13px/1.231 arial, helvetica, clean, sans-serif; } - -/* end moodle modification */ - +/* End moodle modification */ td.sorted { color:#0000FF; diff --git a/lib/xhprof/xhprof_html/index.php b/lib/xhprof/xhprof_html/index.php index e032916e175..4748424500e 100644 --- a/lib/xhprof/xhprof_html/index.php +++ b/lib/xhprof/xhprof_html/index.php @@ -31,12 +31,12 @@ // Changhao Jiang // -// start moodle modification: moodleize this script +// Start moodle modification: moodleize this script. require_once(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php'); require_once($CFG->libdir . '/xhprof/xhprof_moodle.php'); require_login(); require_capability('moodle/site:config', context_system::instance()); -// end moodle modification +// End moodle modification. // by default assume that xhprof_html & xhprof_lib directories // are at the same level. @@ -87,10 +87,10 @@ $vbbar = ' class="vbbar"'; $vrbar = ' class="vrbar"'; $vgbar = ' class="vgbar"'; -// start moodle modification: use own XHProfRuns implementation -//$xhprof_runs_impl = new XHProfRuns_Default() +// Start moodle modification: use own XHProfRuns implementation. +// $xhprof_runs_impl = new XHProfRuns_Default(); $xhprof_runs_impl = new moodle_xhprofrun(); -// end moodle modification +// End moodle modification. displayXHProfReport($xhprof_runs_impl, $params, $source, $run, $wts, $symbol, $sort, $run1, $run2); diff --git a/lib/xhprof/xhprof_html/jquery/indicator.gif b/lib/xhprof/xhprof_html/jquery/indicator.gif index 085ccaecaf5..9c26a717c1b 100644 Binary files a/lib/xhprof/xhprof_html/jquery/indicator.gif and b/lib/xhprof/xhprof_html/jquery/indicator.gif differ diff --git a/lib/xhprof/xhprof_html/typeahead.php b/lib/xhprof/xhprof_html/typeahead.php index 78a753792b9..0cebba7b9fe 100644 --- a/lib/xhprof/xhprof_html/typeahead.php +++ b/lib/xhprof/xhprof_html/typeahead.php @@ -21,12 +21,12 @@ * Changhao Jiang */ -// start moodle modification: moodleize this script +// Start moodle modification: moodleize this script. require_once(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php'); require_once($CFG->libdir . '/xhprof/xhprof_moodle.php'); require_login(); require_capability('moodle/site:config', context_system::instance()); -// end moodle modification +// End moodle modification. // by default assume that xhprof_html & xhprof_lib directories // are at the same level. @@ -34,10 +34,9 @@ $GLOBALS['XHPROF_LIB_ROOT'] = dirname(__FILE__) . '/../xhprof_lib'; require_once $GLOBALS['XHPROF_LIB_ROOT'].'/display/xhprof.php'; -// start moodle modification: use own XHProfRuns implementation -//$xhprof_runs_impl = new XHProfRuns_Default(); -require_once($GLOBALS['XHPROF_LIB_ROOT'].'/../xhprof_moodle.php'); +// Start moodle modification: use own XHProfRuns implementation. +// $xhprof_runs_impl = new XHProfRuns_Default(); $xhprof_runs_impl = new moodle_xhprofrun(); -// end moodle modification +// End moodle modification. require_once $GLOBALS['XHPROF_LIB_ROOT'].'/display/typeahead_common.php'; diff --git a/lib/xhprof/xhprof_lib/utils/callgraph_utils.php b/lib/xhprof/xhprof_lib/utils/callgraph_utils.php index 203ecee0feb..93ccaa63daa 100644 --- a/lib/xhprof/xhprof_lib/utils/callgraph_utils.php +++ b/lib/xhprof/xhprof_lib/utils/callgraph_utils.php @@ -25,6 +25,7 @@ $xhprof_legal_image_types = array( "jpg" => 1, "gif" => 1, "png" => 1, + "svg" => 1, // support scalable vector graphic "ps" => 1, ); @@ -68,6 +69,9 @@ function xhprof_generate_mime_header($type, $length) { case 'png': $mime = 'image/png'; break; + case 'svg': + $mime = 'image/svg+xml'; // content type for scalable vector graphic + break; case 'ps': $mime = 'application/postscript'; default: @@ -103,11 +107,11 @@ function xhprof_generate_image_by_dot($dot_script, $type) { 2 => array("pipe", "w") ); - // start moodle modification: use $CFG->pathtodot for executing this - //$cmd = " dot -T".$type; + // Start moodle modification: use $CFG->pathtodot for executing this. + // $cmd = " dot -T".$type; global $CFG; $cmd = (!empty($CFG->pathtodot) ? $CFG->pathtodot : 'dot') . ' -T' . $type; - // end moodle modification + // End moodle modification. $process = proc_open($cmd, $descriptorspec, $pipes, "/tmp", array()); if (is_resource($process)) { diff --git a/lib/xhprof/xhprof_lib/utils/xhprof_runs.php b/lib/xhprof/xhprof_lib/utils/xhprof_runs.php index c12f77cb26c..cde5ff556bf 100644 --- a/lib/xhprof/xhprof_lib/utils/xhprof_runs.php +++ b/lib/xhprof/xhprof_lib/utils/xhprof_runs.php @@ -149,7 +149,9 @@ class XHProfRuns_Default implements iXHProfRuns { function list_runs() { if (is_dir($this->dir)) { echo "
Existing runs:\n