Stampy\CSSCrush
Synopsis
class CSSCrush
extends Object
implements
Flushable
{
- // constants
- const CACHE_KEY_PREFIX = 'csscrush';
- // members
- private static array $options = ;
- protected array $css_tracked = ;
- protected $_options = NULL;
- private boolean $_has_init = false;
- private boolean $_has_recompiled_css = false;
- private array $_cache_css_tracked = ;
- // methods
- public array|false css()
- public void __construct()
- public void requireDefaultRecords()
- public static void flush()
- public void init()
- public void processCSS()
- public array getOptions()
- protected Zend_Cache_Core getCache()
- public void recompileTrackedCSS()
- protected array|false loadFromCache()
- public void writeToCache()
- protected string getTheme()
- public boolean isCSSArrayDiff()
Hierarchy
Extends
- Object
Implements
- Flushable
Tasks
Line | Task |
---|---|
95 | (Jake): Properly implement and test this. |
171 | (Jake): Allow a custom backend (ie. Redis?) |
173 | (Jake): Allow cacheDir to be configurable |
Constants
Name | Value |
---|---|
CACHE_KEY_PREFIX | 'csscrush' |
Members
private
- $_cache_css_tracked
—
array
Tracked CSS files from cache (from a previous request) - $_has_init
—
boolean
Check if $this->init() has been called - $_has_recompiled_css
—
boolean
Stops recompilation of files twice in one request -
$options
Change settings on CSSCrush
protected
- $_options — array
- $css_tracked
—
array
Track built CSS files.
Methods
protected
- getCache() — Get cache object
- getTheme() — Get theme (or blank if in CMS / no theme)
- loadFromCache()
public
- __construct()
- css() — To be used with the provided or your own alternate Requirements_Backend
- flush() — Called during ?flush=all
- getOptions()
- init() — Initialize additional configurations for CSSCrush.
- isCSSArrayDiff() — Check if two CSS file lists are identical or not.
- processCSS() — Process a CSS file with CSSCrush.
- recompileTrackedCSS() — Load built CSS files. This function exists so cached pages can rebuild the CSS without re-running all the page logic.
- requireDefaultRecords() — Called during /dev/build
- writeToCache() — At the end of the request, store all the built CSS files.