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