Skip to content

Instantly share code, notes, and snippets.

@mrverrall
Last active May 30, 2017 11:15
Show Gist options
  • Save mrverrall/320a7b63b28a8f9d4852bf0c0f7f243c to your computer and use it in GitHub Desktop.
Save mrverrall/320a7b63b28a8f9d4852bf0c0f7f243c to your computer and use it in GitHub Desktop.
<?php
# For Moodle 3.3
# This script belongs in ./admin/cli/
# Copyright 2017 Paul Verrall
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->dirroot.'/lib/csslib.php');
$themename = $CFG->theme;
$theme= theme_config::load($themename);
$rev = theme_get_revision();
$candidatedir = "$CFG->localcachedir/theme/$rev/$themename/css";
$candidatesheet = "$candidatedir/all.css";
if (file_exists($candidatesheet)) {
exit;
} else {
$csscontent = $theme->get_css_content();
make_localcache_directory('theme', false);
css_store_css($theme, "$candidatedir/all.css", $csscontent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment