Issue #390: Code cleanup to fix code standards codesniffer errors.

This commit is contained in:
abhinavgandham
2026-01-12 15:08:32 +10:00
parent 42dbec5b4d
commit 7f968b2365
52 changed files with 481 additions and 363 deletions

View File

@@ -29,11 +29,10 @@
*
* @var stdClass $CFG
*/
define('MOODLE_INTERNAL', true);
defined('MOODLE_INTERNAL') || die();
if (!defined('MOODLE_INTERNAL')) {
define('MOODLE_INTERNAL', true);
}
defined('MOODLE_INTERNAL') || die(); // Make sniffer happy.
//
// We need the CFG->dataroot, if not set yet this script is called too early in config.php file.
if (!isset($CFG->dataroot)) {
@@ -42,7 +41,7 @@ if (!isset($CFG->dataroot)) {
// 1) Make sure we replace the configurations for behat as we have not ran 'lib/setup.php' yet.
if (!empty($CFG->behat_wwwroot) || !empty($CFG->behat_dataroot) || !empty($CFG->behat_prefix)) {
require_once(__DIR__.'/../../lib/behat/lib.php');
require_once(__DIR__ . '/../../lib/behat/lib.php');
behat_update_vars_for_process();
if (behat_is_test_site()) {
$beforebehatcfg = $CFG;
@@ -76,11 +75,11 @@ if (!empty($_SERVER['REQUEST_URI'])) {
if (array_key_exists('path', $rooturl) && !empty($rooturl['path'])) {
$path = $rooturl['path'];
}
$url = $path.'/auth/outage/info.php';
$url = $path . '/auth/outage/info.php';
$outageinfo = strpos($_SERVER['REQUEST_URI'], $url) === 0 ? true : false;
}
$allowed = !file_exists($CFG->dataroot.'/climaintenance.php') // Not in maintenance mode.
$allowed = !file_exists($CFG->dataroot . '/climaintenance.php') // Not in maintenance mode.
|| (defined('ABORT_AFTER_CONFIG') && ABORT_AFTER_CONFIG) // Only config requested.
|| (defined('CLI_SCRIPT') && CLI_SCRIPT) // Allow CLI scripts.
|| $outageinfo // Allow outage info requests.
@@ -89,7 +88,7 @@ if (!$allowed) {
// Call the climaintenance.php which will check for the conditions
// that have been baked into it from the frontend (ip, accesskey, etc...).
$CFG->dirroot = dirname(dirname(dirname(__FILE__))); // It is not defined yet but the script below needs it.
require($CFG->dataroot.'/climaintenance.php'); // This call may terminate the script here or not.
require($CFG->dataroot . '/climaintenance.php'); // This call may terminate the script here or not.
}
// 4) Set flag this file was loaded.