Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/minify/utils.php File Reference

Go to the source code of this file.

Namespaces

namespace  Minify

Functions

 Minify_groupUri ($group, $forceAmpersand=false)
 Minify_groupsMtime ($groups)

Function Documentation

Minify_groupsMtime ( groups)

Get the last modification time of the source js/css files used by Minify to build the page.

If you're caching the output of Minify_groupUri(), you'll want to rebuild the cache if it's older than this timestamp.

// simplistic HTML cache system $file = '/path/to/cache/file'; if (! file_exists($file) || filemtime($file) < Minify_groupsMtime(array('js', 'css'))) { // (re)build cache $page = buildPage(); // this calls Minify_groupUri() for js and css file_put_contents($file, $page); echo $page; exit(); } readfile($file);

Parameters:
array$groupsan array of keys from groupsConfig.php
Returns:
int Unix timestamp of the latest modification

Definition at line 65 of file utils.php.

Minify_groupUri ( group,
forceAmpersand = false 
)

Get a timestamped URI to a minified resource using the default Minify install

<link rel="stylesheet" type="text/css" href="<?php echo Minify_groupUri('css'); ?>"> <script type="text/javascript" src="<?php echo Minify_groupUri('js'); ?>"></script>

If you do not want ampersands as HTML entities, set Minify_Build::$ampersand = "&" before using this function.

Parameters:
string$groupa key from groupsConfig.php
boolean$forceAmpersand(default false) Set to true if the RewriteRule directives in .htaccess are functional. This will remove the "?" from URIs, making them more cacheable by proxies.
Returns:
string

Definition at line 30 of file utils.php.

 All Data Structures Namespaces Files Functions Variables Enumerations