diff --git a/plugins/StoreRemoteMedia/scripts/removeRemoteMedia.php b/plugins/StoreRemoteMedia/scripts/removeRemoteMedia.php new file mode 100755 index 0000000000..8b94ac04c4 --- /dev/null +++ b/plugins/StoreRemoteMedia/scripts/removeRemoteMedia.php @@ -0,0 +1,82 @@ +#!/usr/bin/env php +. + * + * @category Plugin + * @package GNUsocial + * @copyright 2018 Free Software Foundation http://fsf.org + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link https://www.gnu.org/software/social/ + */ + +// Script author: Diogo Cordeiro + +define('INSTALLDIR', realpath(__DIR__ . '/../../..')); + +$longoptions = ['limit=']; + +$helptext = <<query($query); +while ($fn->fetch()) { + $file = File::getByID($fn->file_id); + $file_info_id = $file->getID(); + // Delete current file + $file->delete(); + if (!$quiet) { + echo "Deleted file with id: {$file_info_id}\n"; + } +}