mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 10:46:54 +02:00
Forcing a hard clear-cache for self upgrade only and soft clear-cache for install/update of themes/plugins
This commit is contained in:
@@ -64,10 +64,14 @@ trait ConsoleTrait
|
||||
}
|
||||
}
|
||||
|
||||
public function clearCache()
|
||||
public function clearCache($all = [])
|
||||
{
|
||||
if ($all) {
|
||||
$all = ['--all' => true];
|
||||
}
|
||||
|
||||
$command = new ClearCacheCommand();
|
||||
$input = new ArrayInput(array('--all' => true));
|
||||
$input = new ArrayInput($all);
|
||||
return $command->run($input, $this->output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,6 +114,9 @@ class InstallCommand extends Command
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clear cache after successful upgrade
|
||||
$this->clearCache();
|
||||
}
|
||||
|
||||
private function downloadPackage($package)
|
||||
|
||||
@@ -7,7 +7,6 @@ use Grav\Common\GPM\Installer;
|
||||
use Grav\Common\GPM\Response;
|
||||
use Grav\Console\ConsoleTrait;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
@@ -117,7 +116,7 @@ class SelfupgradeCommand extends Command
|
||||
}
|
||||
|
||||
// clear cache after successful upgrade
|
||||
$this->clearCache();
|
||||
$this->clearCache(true);
|
||||
}
|
||||
|
||||
private function download($package)
|
||||
|
||||
@@ -128,6 +128,9 @@ class UpdateCommand extends Command
|
||||
$this->output->writeln("<red>Error:</red> An error occured while trying to install the extensions");
|
||||
exit;
|
||||
}
|
||||
|
||||
// clear cache after successful upgrade
|
||||
$this->clearCache();
|
||||
}
|
||||
|
||||
private function userInputPackages($onlyPackages)
|
||||
|
||||
Reference in New Issue
Block a user