chimera-mark2-core-release/fox-cron.d/expungeFiles.php

26 lines
441 B
PHP
Raw Permalink Normal View History

2022-08-23 21:40:48 +00:00
#!/usr/bin/php
<?php
/**
*
* Script expungeFiles.php
*
* @copyright MX STAR LLC 2018-2022
* @version 4.0.0
* @author Pavel Dmitriev
* @license GPLv3
*
**/
use fox\file;
if (php_sapi_name() != 'cli') {
throw new Exception("This script can be run via CLI only");
}
require_once(getenv("FOX_WEBROOT")."/Autoloader.php");
$list = file::search(options: ["expired"=>1]);
foreach ($list->result as $file) {
$file->delete();
}