Skip to content
Extraits de code Groupes Projets
Valider b3264993 rédigé par JamesRezo's avatar JamesRezo :tada:
Parcourir les fichiers

feat: asset cache dirs as SpipPaths constants

parent 2a7385ba
Aucune branche associée trouvée
Étiquettes v2.4.1
1 requête de fusion!8feat: asset cache dirs as SpipPaths constants
......@@ -12,8 +12,8 @@ class AssetsClearCache
{
/** @var string[] */
private static array $dirs = [
'cache-css',
'cache-js',
SpipPaths::DIR_ASSETS_CSS,
SpipPaths::DIR_ASSETS_JS,
];
/**
......@@ -30,7 +30,7 @@ class AssetsClearCache
$f = new Filesystem;
foreach (self::$dirs as $dir) {
$toDelete = $vendorDir . '../' . SpipPaths::VAR . '/' . $dir;
$toDelete = $vendorDir . '../' . \str_replace('%spip.dirs.var%', SpipPaths::VAR, $dir);
if ($f->exists($toDelete)) {
$f->remove($toDelete);
}
......
......@@ -15,4 +15,9 @@ class SpipPaths
public const DOC = 'IMG';
public const LOCAL_COMPOSER = 'composer.local.json';
public const LOCAL_PLUGINS_DIST = 'plugins-dist.json';
public const DIR_CACHE = '%spip.dirs.tmp%/cache';
public const DIR_ASSETS_CSS = '%spip.dirs.var%/cache-css';
public const DIR_ASSETS_JS = '%spip.dirs.var%/cache-js';
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter