mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix cache clearing
This commit is contained in:
parent
da5ee15b40
commit
078becb0b7
@ -266,6 +266,14 @@ if ($path_to_config) {
|
|||||||
$config = Config::getConfigForPath($current_dir, $current_dir, $output_format);
|
$config = Config::getConfigForPath($current_dir, $current_dir, $output_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($options['clear-cache'])) {
|
||||||
|
$cache_directory = $config->getCacheDirectory();
|
||||||
|
|
||||||
|
Config::removeCacheDirectory($cache_directory);
|
||||||
|
echo 'Cache directory deleted' . PHP_EOL;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$project_checker = new ProjectChecker(
|
$project_checker = new ProjectChecker(
|
||||||
$config,
|
$config,
|
||||||
new Psalm\Provider\FileProvider(),
|
new Psalm\Provider\FileProvider(),
|
||||||
@ -282,14 +290,6 @@ if ($find_dead_code || $find_references_to !== null) {
|
|||||||
$project_checker->getCodebase()->collectReferences();
|
$project_checker->getCodebase()->collectReferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['clear-cache'])) {
|
|
||||||
$cache_directory = Config::getInstance()->getCacheDirectory();
|
|
||||||
|
|
||||||
Config::removeCacheDirectory($cache_directory);
|
|
||||||
echo 'Cache directory deleted' . PHP_EOL;
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @var string $plugin_path */
|
/** @var string $plugin_path */
|
||||||
foreach ($plugins as $plugin_path) {
|
foreach ($plugins as $plugin_path) {
|
||||||
Config::getInstance()->addPluginPath($current_dir . DIRECTORY_SEPARATOR . $plugin_path);
|
Config::getInstance()->addPluginPath($current_dir . DIRECTORY_SEPARATOR . $plugin_path);
|
||||||
|
Loading…
Reference in New Issue
Block a user