public static function handleRunOnce()
{
try {
$files = \System::getContainer()->get('contao.resource_locator')->locate('config/runonce.php', null, false);
} catch (\InvalidArgumentException $e) {
return;
}
foreach ($files as $file) {
try {
include $file;
} catch (\Exception $e) {
}
$strRelpath = str_replace(TL_ROOT . DIRECTORY_SEPARATOR, '', $file);
if (!unlink($file)) {
throw new \Exception("The file {$strRelpath} cannot be deleted. Please remove the file manually and correct the file permission settings on your server.");
}
\System::log("File {$strRelpath} ran once and has then been removed successfully", __METHOD__, TL_GENERAL);
}
}