Merge branch 'MDL-69740_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE
This commit is contained in:
@@ -187,10 +187,13 @@ if ($options['install']) {
|
||||
behat_config_manager::set_behat_run_config_value('axe', $options['axe']);
|
||||
|
||||
// Enable test mode.
|
||||
$timestart = microtime(true);
|
||||
mtrace('Creating Behat configuration ...', '');
|
||||
behat_util::start_test_mode($options['add-core-features-to-theme'], $options['optimize-runs'], $parallel, $run);
|
||||
mtrace(' done in ' . round(microtime(true) - $timestart, 2) . ' seconds.');
|
||||
|
||||
// Themes are only built in the 'enable' command.
|
||||
behat_util::build_themes();
|
||||
behat_util::build_themes(true);
|
||||
mtrace("Testing environment themes built");
|
||||
|
||||
// This is only displayed once for parallel install.
|
||||
|
||||
@@ -135,7 +135,7 @@ class behat_util extends testing_util {
|
||||
/**
|
||||
* Build theme CSS.
|
||||
*/
|
||||
public static function build_themes() {
|
||||
public static function build_themes($mtraceprogress = false) {
|
||||
global $CFG;
|
||||
require_once("{$CFG->libdir}/outputlib.php");
|
||||
|
||||
@@ -147,7 +147,7 @@ class behat_util extends testing_util {
|
||||
}, $themenames);
|
||||
|
||||
// Build the list of themes and cache them in local cache.
|
||||
$themes = theme_build_css_for_themes($themeconfigs, ['ltr'], true);
|
||||
$themes = theme_build_css_for_themes($themeconfigs, ['ltr'], true, $mtraceprogress);
|
||||
|
||||
$framework = self::get_framework();
|
||||
$storageroot = self::get_dataroot() . "/{$framework}/themedata";
|
||||
@@ -278,7 +278,6 @@ class behat_util extends testing_util {
|
||||
* @return void
|
||||
*/
|
||||
public static function start_test_mode($themesuitewithallfeatures = false, $tags = '', $parallelruns = 0, $run = 0) {
|
||||
global $CFG;
|
||||
|
||||
if (!defined('BEHAT_UTIL')) {
|
||||
throw new coding_exception('This method can be only used by Behat CLI tool');
|
||||
|
||||
+10
-1
@@ -181,7 +181,8 @@ function theme_get_css_filename($themename, $globalrevision, $themerevision, $di
|
||||
* @param bool $cache Should the generated files be stored in local cache.
|
||||
* @return array The built theme content in a multi-dimensional array of name => direction => content
|
||||
*/
|
||||
function theme_build_css_for_themes($themeconfigs = [], $directions = ['rtl', 'ltr'], $cache = true): array {
|
||||
function theme_build_css_for_themes($themeconfigs = [], $directions = ['rtl', 'ltr'],
|
||||
$cache = true, $mtraceprogress = false): array {
|
||||
global $CFG;
|
||||
|
||||
if (empty($themeconfigs)) {
|
||||
@@ -202,6 +203,11 @@ function theme_build_css_for_themes($themeconfigs = [], $directions = ['rtl', 'l
|
||||
|
||||
// First generate all the new css.
|
||||
foreach ($directions as $direction) {
|
||||
if ($mtraceprogress) {
|
||||
$timestart = microtime(true);
|
||||
mtrace('Building theme CSS for ' . $themeconfig->name . ' [' .
|
||||
$direction . '] ...', '');
|
||||
}
|
||||
// Lock it on. Technically we should build all themes for SVG and no SVG - but ie9 is out of support.
|
||||
$themeconfig->force_svg_use(true);
|
||||
$themeconfig->set_rtl_mode(($direction === 'rtl'));
|
||||
@@ -212,6 +218,9 @@ function theme_build_css_for_themes($themeconfigs = [], $directions = ['rtl', 'l
|
||||
$filename = theme_get_css_filename($themeconfig->name, $themerev, $newrevision, $direction);
|
||||
css_store_css($themeconfig, $filename, $themecss[$direction]);
|
||||
}
|
||||
if ($mtraceprogress) {
|
||||
mtrace(' done in ' . round(microtime(true) - $timestart, 2) . ' seconds.');
|
||||
}
|
||||
}
|
||||
$themescss[$themeconfig->name] = $themecss;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user