$useBuildDir =
$realBuildDir !==
$realCacheDir;
$oldBuildDir =
substr($realBuildDir, 0, -1
).
(str_ends_with($realBuildDir, '~'
) ? '+' : '~'
);
if ($useBuildDir) { $fs->
remove($oldBuildDir);
if (!
is_writable($realBuildDir)) { throw new RuntimeException(sprintf('Unable to write in the "%s" directory.',
$realBuildDir));
} if ($this->
isNfs($realCacheDir)) { $fs->
remove($realCacheDir);
} else { $fs->
rename($realCacheDir,
$oldCacheDir);
} $fs->
mkdir($realCacheDir);
} $io->
comment(sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>',
$kernel->
getEnvironment(),
var_export($kernel->
isDebug(), true
)));
if ($useBuildDir) { $this->cacheClearer->
clear($realBuildDir);
}