SilverCart\View\Requirements_Backend
Requirements Backend.
Fixes a bug with combined files.
<code>
// this code should be used when combining files in live mode, but it isn't.
ModuleResourceLoader::singleton()->resolvePath($file);
</code>
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2018 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class Requirements_Backend
extends Requirements_Backend
{
- // members
- private static bool $force_combine_files = false;
- private static bool $force_combine_files_async = true;
- private static array $skip_combine_files = ;
- protected bool $minifyCombinedFiles = true;
- protected boolean $writeHeaderComment = false;
- // methods
- public $this __construct()
- public string includeInHTML()
- public void combineFiles()
- public void processCombinedFiles()
- protected string|null getCombinedFileURL()
- protected void forceCombineFiles()
- protected string insertScriptsIntoBody()
- public int findScriptTagPosition()
Hierarchy
Extends
- SilverStripe\View\Requirements_Backend
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Extensible
Members
private
- $force_combine_files
—
SilverCart\View\bool
Determines whether to force CSS/JS file combination. - $force_combine_files_async
—
SilverCart\View\bool
Determines whether to force CSS/JS file combination. - $skip_combine_files
—
array
List of file names to skip combining files for.
protected
- $minifyCombinedFiles
—
SilverCart\View\bool
Use the injected minification service to minify any javascript file passed to {@link combine_files()}. - $writeHeaderComment
—
boolean
Whether or not file headers should be written when combining files
Methods
protected
- forceCombineFiles() — Combines all CSS and JS files.
- getCombinedFileURL() — Given a set of files, combine them (as necessary) and return the url
- insertScriptsIntoBody() — ------------------------------------------------------------------------- -------------------------------------------------------------------------
public
- __construct() — Sets the default minifier.
- combineFiles() — ------------------------------------------------------------------------- -------------------------------------------------------------------------
- findScriptTagPosition() — Returns the position of a <script> tag. LD+JSON is ignored.
- includeInHTML() — ------------------------------------------------------------------------- -------------------------------------------------------------------------
- processCombinedFiles() — Do the heavy lifting involved in combining the combined files.