class CssCollectionOptimizer in Flysystem 8
Same name and namespace in other branches
- 3.x src/Asset/CssCollectionOptimizer.php \Drupal\flysystem\Asset\CssCollectionOptimizer
- 2.0.x src/Asset/CssCollectionOptimizer.php \Drupal\flysystem\Asset\CssCollectionOptimizer
- 3.0.x src/Asset/CssCollectionOptimizer.php \Drupal\flysystem\Asset\CssCollectionOptimizer
Optimizes CSS assets.
Hierarchy
- class \Drupal\Core\Asset\CssCollectionOptimizer implements AssetCollectionOptimizerInterface
- class \Drupal\flysystem\Asset\CssCollectionOptimizer uses SchemeExtensionTrait
Expanded class hierarchy of CssCollectionOptimizer
2 files declare their use of CssCollectionOptimizer
- FlysystemServiceProviderTest.php in tests/
src/ Unit/ FlysystemServiceProviderTest.php - JsCollectionOptimizerTest.php in tests/
src/ Unit/ Asset/ JsCollectionOptimizerTest.php
File
- src/
Asset/ CssCollectionOptimizer.php, line 14
Namespace
Drupal\flysystem\AssetView source
class CssCollectionOptimizer extends DrupalCssCollectionOptimizer {
use SchemeExtensionTrait;
/**
* {@inheritdoc}
*/
public function deleteAll() {
$this->state
->delete('drupal_css_cache_files');
$delete_stale = function ($uri) {
// Default stale file threshold is 30 days.
if (REQUEST_TIME - filemtime($uri) > \Drupal::config('system.performance')
->get('stale_file_threshold')) {
file_unmanaged_delete($uri);
}
};
file_scan_directory($this
->getSchemeForExtension('css') . '://css', '/.*/', [
'callback' => $delete_stale,
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CssCollectionOptimizer:: |
protected | property | An asset dumper. | |
CssCollectionOptimizer:: |
protected | property | The file system service. | |
CssCollectionOptimizer:: |
protected | property | A CSS asset grouper. | |
CssCollectionOptimizer:: |
protected | property | A CSS asset optimizer. | |
CssCollectionOptimizer:: |
protected | property | The state key/value store. | |
CssCollectionOptimizer:: |
public | function |
Deletes all optimized asset collections assets. Overrides CssCollectionOptimizer:: |
|
CssCollectionOptimizer:: |
protected | function | Generate a hash for a given group of CSS assets. | |
CssCollectionOptimizer:: |
public | function |
Returns all optimized asset collections assets. Overrides AssetCollectionOptimizerInterface:: |
|
CssCollectionOptimizer:: |
public | function |
The cache file name is retrieved on a page load via a lookup variable that
contains an associative array. The array key is the hash of the file names
in $css while the value is the cache file name. The cache file is generated
in two cases. First, if… Overrides AssetCollectionOptimizerInterface:: |
|
CssCollectionOptimizer:: |
public | function | Constructs a CssCollectionOptimizer. | |
SchemeExtensionTrait:: |
public | function | Returns the scheme that should serve an extension. |