CacheCommands.php in Helper 8
File
src/Commands/CacheCommands.php
View source
<?php
namespace Drupal\helper\Commands;
use Drupal\Core\Cache\Cache;
use Drush\Commands\core\CacheCommands as DrushCacheCommands;
use Drush\Commands\DrushCommands;
class CacheCommands extends DrushCommands {
public function alterCacheTypes(array &$types, $include_bootstrapped_types) {
if ($include_bootstrapped_types) {
$types['libraries'] = [
$this,
'clearLibraries',
];
$types['bootstrap'] = [
$this,
'clearBootstrap',
];
}
}
public static function clearLibraries() {
Cache::invalidateTags([
'library_info',
]);
DrushCacheCommands::clearCssJs();
}
public static function clearBootstrap() {
\Drupal::cache('bootstrap')
->deleteAll();
}
}