{
//number of hours until cache will be invalid
protected int $cache_timeout = 24;
+ protected bool $nocache = false;
/**
* Handle cache
*/
protected function handleCache(bool $nocache = false): void
{
+ $this->nocache = $nocache;
if ($nocache === false && !Galette::isDebugEnabled()) {
if (!$this->checkCache()) {
$this->makeCache();
*/
protected function makeCache(): void
{
+ if ($this->nocache === true) {
+ //for some reason, we do not want to use cache
+ return;
+ }
$this->prepareForCache();
$cfile = $this->getCacheFilename();
$cdir = dirname($cfile);
/** @var array<string, mixed> */
private array $default_options = [
'timeout' => 2.0,
+ 'verify' => false
];
private ?string $latest = null;
if (!isset($this->latest)) {
$this->latest = $this->findLatestRelease();
}
+ if ($this->latest === null) {
+ //disable caching, no version has been found
+ $this->nocache = true;
+ }
return $this->latest;
}