From 7dab063a729c3c931c4d999d5bddb4eb468c8142 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sun, 25 Apr 2021 21:24:43 +0000 Subject: [PATCH] [PLUGINS] Remove scripts. These will need to be implemented with Commands --- plugins/ImageEncoder/ImageEncoder.php | 5 +- .../scripts/deleteRemoteMedia.php | 80 ------------------- plugins/VideoEncoder/VideoEncoder.php | 2 + 3 files changed, 4 insertions(+), 83 deletions(-) delete mode 100755 plugins/StoreRemoteMedia/scripts/deleteRemoteMedia.php diff --git a/plugins/ImageEncoder/ImageEncoder.php b/plugins/ImageEncoder/ImageEncoder.php index e703dfa13c..bf0d2ed666 100644 --- a/plugins/ImageEncoder/ImageEncoder.php +++ b/plugins/ImageEncoder/ImageEncoder.php @@ -28,7 +28,6 @@ use App\Entity\AttachmentThumbnail; use App\Util\Common; use Exception; use Jcupitt\Vips; -use Symfony\Component\HttpFoundation\File\File as SymfonyFile; class ImageEncoder extends Plugin { @@ -48,9 +47,9 @@ class ImageEncoder extends Plugin * * @return bool */ - public function onAttachmentValidation(SymfonyFile &$sfile, ?string &$mimetype = null): bool + public function onAttachmentValidation(\SplFileInfo &$file, ?string &$mimetype = null): bool { - $original_mimetype = $mimetype ?? $sfile->getMimeType(); + $original_mimetype = $mimetype; // TODO: Encode in place //$mimetype = self::preferredType(); return Event::stop; diff --git a/plugins/StoreRemoteMedia/scripts/deleteRemoteMedia.php b/plugins/StoreRemoteMedia/scripts/deleteRemoteMedia.php deleted file mode 100755 index ff59f059a7..0000000000 --- a/plugins/StoreRemoteMedia/scripts/deleteRemoteMedia.php +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env php -. - -/** - * StoreRemoteMediaPlugin - * - * @category Plugin - * @package GNUsocial - * @author Diogo Peralta Cordeiro - * @author Alexei Sorokin - * @copyright 2018-2021 Free Software Foundation, Inc http://www.fsf.org - * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later - */ - -define('INSTALLDIR', dirname(__DIR__, 3)); -define('PUBLICDIR', INSTALLDIR . DIRECTORY_SEPARATOR . 'public'); - -$shortoptions = 'l::a::i'; -$longoptions = ['limit=', 'all', 'image']; - -$helptext = <<query(sprintf( - <<<'END' - SELECT file_to_post.file_id - FROM file_to_post - INNER JOIN file ON file_to_post.file_id = file.id - INNER JOIN notice ON file_to_post.post_id = notice.id - WHERE notice.is_local = 0 AND notice.modified <= '%1$s' - GROUP BY file_to_post.file_id - ORDER BY MAX(notice.modified) - END, - $fn->escape($max_date) -)); - -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"; - } -} diff --git a/plugins/VideoEncoder/VideoEncoder.php b/plugins/VideoEncoder/VideoEncoder.php index ea60f164c4..9a593db681 100644 --- a/plugins/VideoEncoder/VideoEncoder.php +++ b/plugins/VideoEncoder/VideoEncoder.php @@ -1,4 +1,5 @@ . +// }}} /** * Animated GIF resize support via PHP-FFMpeg