Last active
May 30, 2017 11:15
-
-
Save mrverrall/320a7b63b28a8f9d4852bf0c0f7f243c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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