lib/babel-polyfill/
lib/polyfills/
lib/emoji-data/
+lib/plist/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
"Feature": 0,
"Background": 2,
"Scenario": 2,
+ "Examples": 4,
+ "example": 6,
"Step": 4,
"given": 4,
"and": 4
"no-multiple-empty-lines": "on",
"no-partially-commented-tag-lines": "on",
"no-trailing-spaces": "on",
- "no-unamed-features": "on",
- "no-unamed-scenarios": "on",
- "no-scenario-outlines-without-examples": "on"
+ "no-unnamed-features": "on",
+ "no-unnamed-scenarios": "on",
+ "no-scenario-outlines-without-examples": "on",
+ "no-examples-in-scenarios": "on",
+ "new-line-at-eof": ["on", "yes"]
}
--- /dev/null
+# Primary donations pages.
+custom: ["https://moodle.com/donations/", moodle.org]
lib/babel-polyfill/
lib/polyfills/
lib/emoji-data/
+lib/plist/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
# process (which uses our internal CI system) this file is here for the benefit
# of community developers git clones - see MDL-51458.
-sudo: required
-
# We currently disable Travis notifications entirely until https://github.com/travis-ci/travis-ci/issues/4976
# is fixed.
notifications:
language: php
+os: linux
+
dist: xenial
services:
php:
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
- - 7.3
+ - 7.4
- 7.2
addons:
# Perform an upgrade test too.
- DB=pgsql TASK=UPGRADE
-matrix:
+jobs:
# Enable fast finish.
# This will fail the build if a single job fails (except those in allow_failures).
# It will not stop the jobs from running.
fast_finish: true
include:
- # Run mysql only on 7.3 - it's just too slow
- - php: 7.3
+ # Run mysql only on highest - it's just too slow
+ - php: 7.4
env: DB=mysqli TASK=PHPUNIT
- # Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
- - php: 7.2
+ # Run grunt/npm install on highest version too ('node' is an alias for the latest node.js version.)
+ - php: 7.4
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
cache:
const watchmanClient = new watchman.Client();
const fs = require('fs');
const ComponentList = require(path.resolve('GruntfileComponents.js'));
+ const sass = require('node-sass');
// Verify the node version is new enough.
var expected = semver.validRange(grunt.file.readJSON('package.json').engines.node);
}
},
options: {
+ implementation: sass,
includePaths: ["theme/boost/scss/", "theme/classic/scss/"]
}
},
const options = grunt.config('gherkinlint.options');
// Grab the gherkin-lint linter and required scaffolding.
- const linter = require('gherkin-lint/src/linter.js');
- const featureFinder = require('gherkin-lint/src/feature-finder.js');
- const configParser = require('gherkin-lint/src/config-parser.js');
- const formatter = require('gherkin-lint/src/formatters/stylish.js');
+ const linter = require('gherkin-lint/dist/linter.js');
+ const featureFinder = require('gherkin-lint/dist/feature-finder.js');
+ const configParser = require('gherkin-lint/dist/config-parser.js');
+ const formatter = require('gherkin-lint/dist/formatters/stylish.js');
// Run the linter.
- const results = linter.lint(
+ return linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
- );
-
- // Print the results out uncondtionally.
- formatter.printResults(results);
-
- // Report on the results.
- // The done function takes a bool whereby a falsey statement causes the task to fail.
- done(results.every(result => result.errors.length === 0));
+ )
+ .then(results => {
+ // Print the results out uncondtionally.
+ formatter.printResults(results);
+
+ return results;
+ })
+ .then(results => {
+ // Report on the results.
+ // The done function takes a bool whereby a falsey statement causes the task to fail.
+ return results.every(result => result.errors.length === 0);
+ })
+ .then(done); // eslint-disable-line promise/no-callback-in-promise
};
tasks.startup = function() {
--- /dev/null
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Task executor for adhoc tasks.
+ *
+ * @package core
+ * @subpackage cli
+ * @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+define('CLI_SCRIPT', true);
+
+require(__DIR__ . '/../../config.php');
+require_once("{$CFG->libdir}/clilib.php");
+require_once("{$CFG->libdir}/cronlib.php");
+
+list($options, $unrecognized) = cli_get_params(
+ [
+ 'execute' => false,
+ 'help' => false,
+ 'keep-alive' => 0,
+ 'showsql' => false,
+ 'showdebugging' => false,
+ 'ignorelimits' => false,
+ ], [
+ 'h' => 'help',
+ 'e' => 'execute',
+ 'k' => 'keep-alive',
+ 'i' => 'ignorelimits',
+ ]
+);
+
+if ($unrecognized) {
+ $unrecognized = implode("\n ", $unrecognized);
+ cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
+}
+
+if ($options['help'] or empty($options['execute'])) {
+ $help = <<<EOT
+Ad hoc cron tasks.
+
+Options:
+ -h, --help Print out this help
+ --showsql Show sql queries before they are executed
+ --showdebugging Show developer level debugging information
+ -e, --execute Run all queued adhoc tasks
+ -k, --keep-alive=N Keep this script alive for N seconds and poll for new adhoc tasks
+ -i --ignorelimits Ignore task_adhoc_concurrency_limit and task_adhoc_max_runtime limits
+
+Example:
+\$sudo -u www-data /usr/bin/php admin/cli/adhoc_task.php --execute
+
+EOT;
+
+ echo $help;
+ die;
+}
+
+if ($options['showdebugging']) {
+ set_debugging(DEBUG_DEVELOPER, true);
+}
+
+if ($options['showsql']) {
+ $DB->set_debug(true);
+}
+
+if (CLI_MAINTENANCE) {
+ echo "CLI maintenance mode active, cron execution suspended.\n";
+ exit(1);
+}
+
+if (moodle_needs_upgrading()) {
+ echo "Moodle upgrade pending, cron execution suspended.\n";
+ exit(1);
+}
+
+if (empty($options['execute'])) {
+ exit(0);
+}
+if (empty($options['keep-alive'])) {
+ $options['keep-alive'] = 0;
+}
+
+if (!empty($CFG->showcronsql)) {
+ $DB->set_debug(true);
+}
+if (!empty($CFG->showcrondebugging)) {
+ set_debugging(DEBUG_DEVELOPER, true);
+}
+
+$checklimits = empty($options['ignorelimits']);
+
+core_php_time_limit::raise();
+
+// Increase memory limit.
+raise_memory_limit(MEMORY_EXTRA);
+
+// Emulate normal session - we use admin account by default.
+cron_setup_user();
+
+$humantimenow = date('r', time());
+$keepalive = (int)$options['keep-alive'];
+
+\core\local\cli\shutdown::script_supports_graceful_exit();
+
+mtrace("Server Time: {$humantimenow}\n");
+cron_run_adhoc_tasks(time(), $keepalive, $checklimits);
cli_error('The configuration variable is hard-set in the config.php, unable to change.', 4);
}
- set_config($options['name'], $options['set'], $options['component']);
+ $new = $options['set'];
+ $old = get_config($options['component'], $options['name']);
+ if ($new !== $old) {
+ set_config($options['name'], $options['set'], $options['component']);
+ add_to_config_log($options['name'], $old, $new, $options['component']);
+ }
exit(0);
}
--- /dev/null
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * CLI task execution.
+ *
+ * @package core
+ * @subpackage cli
+ * @copyright 2014 Petr Skoda
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+define('CLI_SCRIPT', true);
+
+require(__DIR__ . '/../../config.php');
+require_once("$CFG->libdir/clilib.php");
+require_once("$CFG->libdir/cronlib.php");
+
+list($options, $unrecognized) = cli_get_params(
+ array('help' => false, 'list' => false, 'execute' => false, 'showsql' => false, 'showdebugging' => false),
+ array('h' => 'help')
+);
+
+if ($unrecognized) {
+ $unrecognized = implode("\n ", $unrecognized);
+ cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
+}
+
+if ($options['help'] or (!$options['list'] and !$options['execute'])) {
+ $help =
+ "Scheduled cron tasks.
+
+ Options:
+ --execute=\\some\\task Execute scheduled task manually
+ --list List all scheduled tasks
+ --showsql Show sql queries before they are executed
+ --showdebugging Show developer level debugging information
+ -h, --help Print out this help
+
+ Example:
+ \$sudo -u www-data /usr/bin/php admin/cli/scheduled_task.php --execute=\\core\\task\\session_cleanup_task
+
+ ";
+
+ echo $help;
+ die;
+}
+
+if ($options['showdebugging']) {
+ set_debugging(DEBUG_DEVELOPER, true);
+}
+
+if ($options['showsql']) {
+ $DB->set_debug(true);
+}
+if ($options['list']) {
+ cli_heading("List of scheduled tasks ($CFG->wwwroot)");
+
+ $shorttime = get_string('strftimedatetimeshort');
+
+ $tasks = \core\task\manager::get_all_scheduled_tasks();
+ echo str_pad(get_string('scheduledtasks', 'tool_task'), 50, ' ') . ' ' . str_pad(get_string('runpattern', 'tool_task'), 17, ' ')
+ . ' ' . str_pad(get_string('lastruntime', 'tool_task'), 40, ' ') . get_string('nextruntime', 'tool_task') . "\n";
+ foreach ($tasks as $task) {
+ $class = '\\' . get_class($task);
+ $schedule = $task->get_minute() . ' '
+ . $task->get_hour() . ' '
+ . $task->get_day() . ' '
+ . $task->get_day_of_week() . ' '
+ . $task->get_month() . ' '
+ . $task->get_day_of_week();
+ $nextrun = $task->get_next_run_time();
+ $lastrun = $task->get_last_run_time();
+
+ $plugininfo = core_plugin_manager::instance()->get_plugin_info($task->get_component());
+ $plugindisabled = $plugininfo && $plugininfo->is_enabled() === false && !$task->get_run_if_component_disabled();
+
+ if ($plugindisabled) {
+ $nextrun = get_string('plugindisabled', 'tool_task');
+ } else if ($task->get_disabled()) {
+ $nextrun = get_string('taskdisabled', 'tool_task');
+ } else if ($nextrun > time()) {
+ $nextrun = userdate($nextrun);
+ } else {
+ $nextrun = get_string('asap', 'tool_task');
+ }
+
+ if ($lastrun) {
+ $lastrun = userdate($lastrun);
+ } else {
+ $lastrun = get_string('never');
+ }
+
+ echo str_pad($class, 50, ' ') . ' ' . str_pad($schedule, 17, ' ') .
+ ' ' . str_pad($lastrun, 40, ' ') . ' ' . $nextrun . "\n";
+ }
+ exit(0);
+}
+
+if ($execute = $options['execute']) {
+ if (!$task = \core\task\manager::get_scheduled_task($execute)) {
+ mtrace("Task '$execute' not found");
+ exit(1);
+ }
+
+ if (moodle_needs_upgrading()) {
+ mtrace("Moodle upgrade pending, cannot execute tasks.");
+ exit(1);
+ }
+
+ // Increase memory limit.
+ raise_memory_limit(MEMORY_EXTRA);
+
+ // Emulate normal session - we use admin account by default.
+ cron_setup_user();
+
+ // Execute the task.
+ \core\local\cli\shutdown::script_supports_graceful_exit();
+ $cronlockfactory = \core\lock\lock_config::get_lock_factory('cron');
+ if (!$cronlock = $cronlockfactory->get_lock('core_cron', 10)) {
+ mtrace('Cannot obtain cron lock');
+ exit(129);
+ }
+ if (!$lock = $cronlockfactory->get_lock('\\' . get_class($task), 10)) {
+ $cronlock->release();
+ mtrace('Cannot obtain task lock');
+ exit(130);
+ }
+
+ $task->set_lock($lock);
+ if (!$task->is_blocking()) {
+ $cronlock->release();
+ } else {
+ $task->set_cron_lock($cronlock);
+ }
+
+ cron_run_inner_scheduled_task($task);
+}
}
} else {
$newsettings = array();
- if (array_key_exists($componentprovidersetting, $form)) {
+ if (property_exists($form, $componentprovidersetting)) {
// We must be processing loggedin or loggedoff checkboxes.
// Store defained comma-separated processors as setting value.
// Using array_filter eliminates elements set to 0 above.
$output = '';
if ($checker->enabled()) {
- $output .= $this->container_start('checkforupdates');
+ $output .= $this->container_start('checkforupdates mb-4');
$output .= $this->single_button(
new moodle_url($reloadurl, array('fetchupdates' => 1)),
get_string('checkforupdates', 'core_plugin')
);
if ($timefetched = $checker->get_last_timefetched()) {
$timefetched = userdate($timefetched, get_string('strftimedatetime', 'core_langconfig'));
- $output .= $this->container(get_string('checkforupdateslast', 'core_plugin', $timefetched), 'lasttimefetched');
+ $output .= $this->container(get_string('checkforupdateslast', 'core_plugin', $timefetched),
+ 'lasttimefetched small text-muted mt-1');
}
$output .= $this->container_end();
}
}
}
- $updateinfo .= $this->container_start('checkforupdates');
+ $updateinfo .= $this->container_start('checkforupdates mt-1');
$fetchurl = new moodle_url('/admin/index.php', array('fetchupdates' => 1, 'sesskey' => sesskey(), 'cache' => 0));
$updateinfo .= $this->single_button($fetchurl, get_string('checkforupdates', 'core_plugin'));
if ($fetch) {
*/
protected function moodle_available_update_info(\core\update\info $updateinfo) {
- $boxclasses = 'moodleupdateinfo';
+ $boxclasses = 'moodleupdateinfo mb-2';
$info = array();
if (isset($updateinfo->release)) {
}
if (isset($updateinfo->download)) {
- $info[] = html_writer::link($updateinfo->download, get_string('download'), array('class' => 'info download'));
+ $info[] = html_writer::link($updateinfo->download, get_string('download'),
+ array('class' => 'info download btn btn-secondary'));
}
if (isset($updateinfo->url)) {
array('class' => 'info more'));
}
- $box = $this->output->box_start($boxclasses);
- $box .= $this->output->box(implode(html_writer::tag('span', ' ', array('class' => 'separator')), $info), '');
- $box .= $this->output->box_end();
+ $box = $this->output->container_start($boxclasses);
+ $box .= $this->output->container(implode(html_writer::tag('span', ' | ', array('class' => 'separator')), $info), '');
+ $box .= $this->output->container_end();
return $box;
}
$displayname = new html_table_cell(
$icon.
html_writer::span($plugin->displayname, 'pluginname').
- html_writer::div($plugin->get_dir(), 'plugindir')
+ html_writer::div($plugin->get_dir(), 'plugindir text-muted small')
);
$versiondb = new html_table_cell($plugin->versiondb);
break;
case core_plugin_manager::PLUGIN_STATUS_NODB:
case core_plugin_manager::PLUGIN_STATUS_UPTODATE:
- $statusclass .= $dependenciesok ? '' : 'badge-warning';
+ $statusclass .= $dependenciesok ? 'badge-light' : 'badge-warning';
break;
}
$status = html_writer::span(get_string('status_' . $statuscode, 'core_plugin'), $statusclass);
new moodle_url($this->page->url, array('abortinstall' => $plugin->component)),
get_string('cancelinstallone', 'core_plugin'),
'post',
- array('class' => 'actionbutton cancelinstallone')
+ array('class' => 'actionbutton cancelinstallone d-block mt-1')
);
}
new moodle_url($this->page->url, array('abortupgrade' => $plugin->component)),
get_string('cancelupgradeone', 'core_plugin'),
'post',
- array('class' => 'actionbutton cancelupgradeone')
+ array('class' => 'actionbutton cancelupgradeone d-block mt-1')
);
}
}
}
- $out .= $this->output->container_start('actions');
+ $out .= $this->output->container_start('actions mb-2');
$installableupdates = $pluginman->filter_installable($pluginman->available_updates());
if ($installableupdates) {
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', count($installableupdates)),
'post',
- array('class' => 'singlebutton updateavailableinstallall')
+ array('class' => 'singlebutton updateavailableinstallall mr-1')
&n