2024-01-17 20:10:32 +01:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove all expired items from the cache
|
|
|
|
*/
|
|
|
|
|
|
|
|
require __DIR__ . '/../lib/bootstrap.php';
|
2024-08-30 02:29:51 +02:00
|
|
|
require __DIR__ . '/../lib/config.php';
|
2024-01-17 20:10:32 +01:00
|
|
|
|
2024-08-29 22:48:59 +02:00
|
|
|
$container = require __DIR__ . '/../lib/dependencies.php';
|
2024-08-07 03:15:43 +02:00
|
|
|
|
2024-08-30 02:29:51 +02:00
|
|
|
if (
|
|
|
|
Configuration::getConfig('cache', 'type') === 'file'
|
|
|
|
&& !Configuration::getConfig('FileCache', 'enable_purge')
|
|
|
|
) {
|
2024-08-30 02:44:50 +02:00
|
|
|
// Override enable_purge for this particular execution
|
2024-08-30 02:29:51 +02:00
|
|
|
Configuration::setConfig('FileCache', 'enable_purge', true);
|
|
|
|
}
|
|
|
|
|
2024-08-30 02:44:50 +02:00
|
|
|
/** @var CacheInterface $cache */
|
|
|
|
$cache = $container['cache'];
|
|
|
|
|
2024-01-17 20:10:32 +01:00
|
|
|
$cache->prune();
|