Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

   1  <?php
   2  //  Copyright (c) 2009 Facebook
   3  //
   4  //  Licensed under the Apache License, Version 2.0 (the "License");
   5  //  you may not use this file except in compliance with the License.
   6  //  You may obtain a copy of the License at
   7  //
   8  //      http://www.apache.org/licenses/LICENSE-2.0
   9  //
  10  //  Unless required by applicable law or agreed to in writing, software
  11  //  distributed under the License is distributed on an "AS IS" BASIS,
  12  //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13  //  See the License for the specific language governing permissions and
  14  //  limitations under the License.
  15  //
  16  
  17  /**
  18   * AJAX endpoint for XHProf function name typeahead.
  19   *
  20   * @author(s)  Kannan Muthukkaruppan
  21   *             Changhao Jiang
  22   */
  23  
  24  // Start moodle modification: moodleize this script.
  25  require_once(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php');
  26  require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
  27  require_login();
  28  require_capability('moodle/site:config', context_system::instance());
  29  \core\session\manager::write_close();
  30  // End moodle modification.
  31  
  32  
  33  // by default assume that xhprof_html & xhprof_lib directories
  34  // are at the same level.
  35  $GLOBALS['XHPROF_LIB_ROOT'] = dirname(__FILE__) . '/../xhprof_lib';
  36  
  37  require_once $GLOBALS['XHPROF_LIB_ROOT'].'/display/xhprof.php';
  38  
  39  // Start moodle modification: use own XHProfRuns implementation.
  40  $xhprof_runs_impl = new moodle_xhprofrun();
  41  // End moodle modification.
  42  
  43  require_once $GLOBALS['XHPROF_LIB_ROOT'].'/display/typeahead_common.php';