diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 4089df2bbb..2b45c3856a 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2900,7 +2900,6 @@ phutil_register_library_map(array( 'PhabricatorFilesManagementGenerateKeyWorkflow' => 'applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php', 'PhabricatorFilesManagementIntegrityWorkflow' => 'applications/files/management/PhabricatorFilesManagementIntegrityWorkflow.php', 'PhabricatorFilesManagementMigrateWorkflow' => 'applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php', - 'PhabricatorFilesManagementPurgeWorkflow' => 'applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php', 'PhabricatorFilesManagementRebuildWorkflow' => 'applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php', 'PhabricatorFilesManagementWorkflow' => 'applications/files/management/PhabricatorFilesManagementWorkflow.php', 'PhabricatorFilesOnDiskBuiltinFile' => 'applications/files/builtin/PhabricatorFilesOnDiskBuiltinFile.php', @@ -8238,7 +8237,6 @@ phutil_register_library_map(array( 'PhabricatorFilesManagementGenerateKeyWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementIntegrityWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementMigrateWorkflow' => 'PhabricatorFilesManagementWorkflow', - 'PhabricatorFilesManagementPurgeWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementRebuildWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorFilesOnDiskBuiltinFile' => 'PhabricatorFilesBuiltinFile', diff --git a/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php deleted file mode 100644 index bf2c04a584..0000000000 --- a/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php +++ /dev/null @@ -1,71 +0,0 @@ -setName('purge') - ->setSynopsis(pht('Delete files with missing data.')) - ->setArguments( - array( - array( - 'name' => 'all', - 'help' => pht('Update all files.'), - ), - array( - 'name' => 'dry-run', - 'help' => pht('Show what would be updated.'), - ), - array( - 'name' => 'names', - 'wildcard' => true, - ), - )); - } - - public function execute(PhutilArgumentParser $args) { - $console = PhutilConsole::getConsole(); - - $iterator = $this->buildIterator($args); - if (!$iterator) { - throw new PhutilArgumentUsageException( - pht( - 'Either specify a list of files to purge, or use `%s` '. - 'to purge all files.', - '--all')); - } - - $is_dry_run = $args->getArg('dry-run'); - - foreach ($iterator as $file) { - $fid = 'F'.$file->getID(); - - try { - $file->loadFileData(); - $okay = true; - } catch (Exception $ex) { - $okay = false; - } - - if ($okay) { - $console->writeOut( - "%s\n", - pht('%s: File data is OK, not purging.', $fid)); - } else { - if ($is_dry_run) { - $console->writeOut( - "%s\n", - pht('%s: Would purge (dry run).', $fid)); - } else { - $console->writeOut( - "%s\n", - pht('%s: Purging.', $fid)); - $file->delete(); - } - } - } - - return 0; - } -}