#!/usr/bin/env php . */ define('INSTALLDIR', dirname(__DIR__)); define('PUBLICDIR', INSTALLDIR . DIRECTORY_SEPARATOR . 'public'); $shortoptions = 'y::a::f'; $longoptions = ['yes', 'all', 'force']; $helptext = <<find(); while ($thumbs->fetch()) { try { $file = $thumbs->getFile(); $is_local = $file->isLocal(); if ($is_local || !$only_local) { // only delete if we can regenerate it if (!$is_local && !have_option('f', 'force')) { try { $file->getPath(); } catch (Exception $e) { // We can't regenerate later if we don't have the original. continue; } } $thumbs->delete(); print '.'; } } catch (NoResultException $e) { // No File object for thumbnail, let's delete the thumbnail entry $thumbs->delete(); print 'x'; } } print "\nDONE.\n";