ProCache File Merger

ProCache methods for minifying and merging CSS and JS filers.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the ProCacheFileMerger class also inherits all the methods and properties of: Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
ProCacheFileMerger::clean()
int

Clean up the merged file cache, removing old/expired files

 
ProCacheFileMerger::clear()
int

Clear out all cached files

 
ProCacheFileMerger::clearFiles($basenames)
int

Clear files by basename

 
ProCacheFileMerger::compileLESS(string $file)
string

Compile a LESS file

 
ProCacheFileMerger::compileSCSS(string $file)
string bool

Compile an SCSS file

 
ProCacheFileMerger::getDestination()
string

Get destination path for merged files

 
ProCacheFileMerger::getFileContents($file)
string

Get the contents of a file

ProCacheFileMerger::getFiles()
array

Get all files in the merge cache (both css and js)

 
ProCacheFileMerger::getHashSRI()
string

SRI hash for inclusion in script tag, only available after a merge() call that specified use of $sri

 
ProCacheFileMerger::getLESS()
lessc

Return instance of LESS compiler

 
ProCacheFileMerger::getMinifierCSS()
MatthiasMullie\Minify\CSS

Get CSS minifier instance

 
ProCacheFileMerger::getMinifierJS()
MatthiasMullie\Minify\JS

Get JS minifier instance

 
ProCacheFileMerger::getNumFiles()
int

Get the number of files in the merge cache

 
ProCacheFileMerger::getSCSS()
ScssPhp\ScssPhp\Compiler

Return instance of SCSS compiler

 
ProCacheFileMerger::init()
None 
ProCacheFileMerger::merge($files)
$this

Given a list of file URLs, merge them into a single file

 
ProCacheFileMerger::mergeCSSFilesInMarkup(string $html)
string

Given contents of an HTML document merge and minify <link rel='stylesheet'> tags

 
ProCacheFileMerger::mergeJSFilesInMarkup(string $html)
string

Given contents of an HTML document merge and minify <script src='...'></script> tags

 
ProCacheFileMerger::minifyInlineCSS(string $out)
int

Minify inline CSS in the given HTML string

 
ProCacheFileMerger::minifyInlineJS(string $out)
int

Minify inline JS in the given HTML string

 
ProCacheFileMerger::path()
string

Get the path for the merged file

 
ProCacheFileMerger::procache()
ProCache

Get or set ProCache instance

 
ProCacheFileMerger::setDestination($destination)
$this

Set the destination for merged files

 
ProCacheFileMerger::setExpiration($seconds)
$this

Set the max age of a cached CSS/JS file

 
ProCacheFileMerger::setExtension($ext)
$this

Set the file extension

 
ProCacheFileMerger::setMaxImportSizeCSS(int $size)
$this

Set the max CSS file import size (for background images, etc.)

 
ProCacheFileMerger::setPrefix($prefix)
$this

Set the file prefix Default:pwpc

 
ProCacheFileMerger::setSource($source)
$this

Set the relative source directory

 
ProCacheFileMerger::updateCSS($out, $file)
None

Adjustments to CSS file contents

 
ProCacheFileMerger::url()
string

Get the URL for the merged file

 

Additional methods and properties

In addition to the methods and properties above, ProCacheFileMerger also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252