mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-76397 lib: Moodle customizations.
This commit is contained in:
parent
ae0ea56f25
commit
bba2bf5ee6
7 changed files with 51 additions and 6 deletions
|
@ -260,7 +260,7 @@ All rights reserved.</copyright>
|
||||||
<location>xhprof</location>
|
<location>xhprof</location>
|
||||||
<name>XHProf</name>
|
<name>XHProf</name>
|
||||||
<description>A Hierarchical Profiler for PHP.</description>
|
<description>A Hierarchical Profiler for PHP.</description>
|
||||||
<version>2.3.8</version>
|
<version>2.3.9</version>
|
||||||
<license>Apache</license>
|
<license>Apache</license>
|
||||||
<licenseversion>2.0</licenseversion>
|
<licenseversion>2.0</licenseversion>
|
||||||
<repository>https://github.com/longxinH/xhprof</repository>
|
<repository>https://github.com/longxinH/xhprof</repository>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Description of XHProf 2.3.5 library/viewer import into Moodle
|
Description of XHProf 2.3.9 library/viewer import into Moodle
|
||||||
|
|
||||||
Removed (commit #1):
|
Removed (commit #1):
|
||||||
* examples - examples dir removed completely
|
* examples - examples dir removed completely
|
||||||
|
@ -41,3 +41,4 @@ TODO:
|
||||||
20201210 - MDL-70297 - Ilya Tregubov (ilyatregubov): Upgrade to 2.2.3 release;
|
20201210 - MDL-70297 - Ilya Tregubov (ilyatregubov): Upgrade to 2.2.3 release;
|
||||||
20210209 - MDL-70525 - Tomo Tsuyuki (tomotsuyuki): Allow huge number of values
|
20210209 - MDL-70525 - Tomo Tsuyuki (tomotsuyuki): Allow huge number of values
|
||||||
20211209 - MDL-71705 - Ilya Tregubov (ilyatregubov): Upgrade to 2.3.5 release;
|
20211209 - MDL-71705 - Ilya Tregubov (ilyatregubov): Upgrade to 2.3.5 release;
|
||||||
|
20221214 - MDL-76397 - Stevani Andolo (stevandoMoodle): Upgrade to 2.3.9 release;
|
||||||
|
|
|
@ -29,6 +29,15 @@
|
||||||
* @author Changhao Jiang (cjiang@facebook.com)
|
* @author Changhao Jiang (cjiang@facebook.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// 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());
|
||||||
|
raise_memory_limit(MEMORY_HUGE);
|
||||||
|
\core\session\manager::write_close();
|
||||||
|
// End moodle modification.
|
||||||
|
|
||||||
// by default assume that xhprof_html & xhprof_lib directories
|
// by default assume that xhprof_html & xhprof_lib directories
|
||||||
// are at the same level.
|
// are at the same level.
|
||||||
$GLOBALS['XHPROF_LIB_ROOT'] = dirname(__FILE__) . '/../xhprof_lib';
|
$GLOBALS['XHPROF_LIB_ROOT'] = dirname(__FILE__) . '/../xhprof_lib';
|
||||||
|
@ -78,7 +87,10 @@ if (!array_key_exists($type, $xhprof_legal_image_types)) {
|
||||||
$type = $params['type'][1]; // default image type.
|
$type = $params['type'][1]; // default image type.
|
||||||
}
|
}
|
||||||
|
|
||||||
$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.
|
||||||
|
|
||||||
if (!empty($run)) {
|
if (!empty($run)) {
|
||||||
// single run call graph image generation
|
// single run call graph image generation
|
||||||
|
|
|
@ -13,6 +13,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Start moodle modification: add basic, smaller, font specs */
|
||||||
|
body, p, table, li {
|
||||||
|
font: normal normal normal 13px/1.231 arial, helvetica, clean, sans-serif;
|
||||||
|
}
|
||||||
|
/* End moodle modification */
|
||||||
|
|
||||||
td.sorted {
|
td.sorted {
|
||||||
color:#0000FF;
|
color:#0000FF;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,15 @@
|
||||||
// Changhao Jiang
|
// Changhao Jiang
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// 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());
|
||||||
|
raise_memory_limit(MEMORY_HUGE);
|
||||||
|
\core\session\manager::write_close();
|
||||||
|
// End moodle modification.
|
||||||
|
|
||||||
// by default assume that xhprof_html & xhprof_lib directories
|
// by default assume that xhprof_html & xhprof_lib directories
|
||||||
// are at the same level.
|
// are at the same level.
|
||||||
$GLOBALS['XHPROF_LIB_ROOT'] = dirname(__FILE__) . '/../xhprof_lib';
|
$GLOBALS['XHPROF_LIB_ROOT'] = dirname(__FILE__) . '/../xhprof_lib';
|
||||||
|
@ -80,7 +89,10 @@ $vbbar = ' class="vbbar"';
|
||||||
$vrbar = ' class="vrbar"';
|
$vrbar = ' class="vrbar"';
|
||||||
$vgbar = ' class="vgbar"';
|
$vgbar = ' class="vgbar"';
|
||||||
|
|
||||||
$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.
|
||||||
|
|
||||||
displayXHProfReport($xhprof_runs_impl, $params, $source, $run, $wts,
|
displayXHProfReport($xhprof_runs_impl, $params, $source, $run, $wts,
|
||||||
$symbol, $sort, $run1, $run2);
|
$symbol, $sort, $run1, $run2);
|
||||||
|
|
|
@ -21,12 +21,22 @@
|
||||||
* Changhao Jiang
|
* Changhao Jiang
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// 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());
|
||||||
|
\core\session\manager::write_close();
|
||||||
|
// End moodle modification.
|
||||||
|
|
||||||
// by default assume that xhprof_html & xhprof_lib directories
|
// by default assume that xhprof_html & xhprof_lib directories
|
||||||
// are at the same level.
|
// are at the same level.
|
||||||
$GLOBALS['XHPROF_LIB_ROOT'] = dirname(__FILE__) . '/../xhprof_lib';
|
$GLOBALS['XHPROF_LIB_ROOT'] = dirname(__FILE__) . '/../xhprof_lib';
|
||||||
|
|
||||||
require_once $GLOBALS['XHPROF_LIB_ROOT'].'/display/xhprof.php';
|
require_once $GLOBALS['XHPROF_LIB_ROOT'].'/display/xhprof.php';
|
||||||
|
|
||||||
$xhprof_runs_impl = new XHProfRuns_Default();
|
// Start moodle modification: use own XHProfRuns implementation.
|
||||||
|
$xhprof_runs_impl = new moodle_xhprofrun();
|
||||||
|
// End moodle modification.
|
||||||
|
|
||||||
require_once $GLOBALS['XHPROF_LIB_ROOT'].'/display/typeahead_common.php';
|
require_once $GLOBALS['XHPROF_LIB_ROOT'].'/display/typeahead_common.php';
|
||||||
|
|
|
@ -107,7 +107,11 @@ function xhprof_generate_image_by_dot($dot_script, $type) {
|
||||||
2 => array("pipe", "w")
|
2 => array("pipe", "w")
|
||||||
);
|
);
|
||||||
|
|
||||||
$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.
|
||||||
|
|
||||||
$process = proc_open( $cmd, $descriptorspec, $pipes, sys_get_temp_dir(), array( 'PATH' => getenv( 'PATH' ) ) );
|
$process = proc_open( $cmd, $descriptorspec, $pipes, sys_get_temp_dir(), array( 'PATH' => getenv( 'PATH' ) ) );
|
||||||
if (is_resource($process)) {
|
if (is_resource($process)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue