@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Increase severity of bin/remove destroy warning

Summary:
Make sure we're 100% clear that this is really, truly not recommended.

Also improve the text itself, and show the objects which are being destroyed more clearly.

Test Plan: Removed objects with `bin/remove destroy`.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D12952

+78 -9
+67 -9
src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php
··· 54 54 } 55 55 } 56 56 57 + $banner = <<<EOBANNER 58 + uuuuuuu 59 + uu###########uu 60 + uu#################uu 61 + u#####################u 62 + u#######################u 63 + u#########################u 64 + u#########################u 65 + u######" "###" "######u 66 + "####" u#u ####" 67 + ###u u#u u### 68 + ###u u###u u### 69 + "####uu### ###uu####" 70 + "#######" "#######" 71 + u#######u#######u 72 + u#"#"#"#"#"#"#u 73 + uuu ##u# # # # #u## uuu 74 + u#### #####u#u#u### u#### 75 + #####uu "#########" uu###### 76 + u###########uu """"" uuuu########## 77 + ####"""##########uuu uu#########"""###" 78 + """ ""###########uu ""#""" 79 + uuuu ""##########uuu 80 + u###uuu#########uu ""###########uuu### 81 + ##########"""" ""###########" 82 + "#####" ""####"" 83 + ###" ####" 84 + 85 + EOBANNER; 86 + 87 + 88 + $console->writeOut("\n\n<fg:red>%s</fg>\n\n", $banner); 89 + 57 90 $console->writeOut( 58 - "<bg:red>**%s**</bg>\n\n", 59 - pht(' IMPORTANT: OBJECTS WILL BE PERMANENTLY DESTROYED! ')); 91 + "<bg:red>** %s **</bg> %s\n\n%s\n\n". 92 + "<bg:red>** %s **</bg> %s\n\n%s\n\n", 93 + pht('IMPORTANT'), 94 + pht('DATA WILL BE PERMANENTLY DESTROYED'), 95 + phutil_console_wrap( 96 + pht( 97 + 'Objects will be permanently destroyed. There is no way to '. 98 + 'undo this operation or ever retrieve this data unless you '. 99 + 'maintain external backups.')), 100 + pht('IMPORTANT'), 101 + pht('DELETING OBJECTS OFTEN BREAKS THINGS'), 102 + phutil_console_wrap( 103 + pht( 104 + 'Destroying objects may cause related objects to stop working, '. 105 + 'and may leave scattered references to objects which no longer '. 106 + 'exist. In most cases, it is much better to disable or archive '. 107 + 'objects instead of destroying them. This risk is greatest when '. 108 + 'deleting complex or highly connected objects like repositories, '. 109 + 'projects and users.'. 110 + "\n\n". 111 + 'These tattered edges are an expected consquence of destroying '. 112 + 'objects, and the Phabricator upstream will not help you fix '. 113 + 'them. We strongly recomend disabling or archiving objects '. 114 + 'instead.'))); 115 + 116 + $phids = mpull($named_objects, 'getPHID'); 117 + $handles = PhabricatorUser::getOmnipotentUser()->loadHandles($phids); 60 118 61 119 $console->writeOut( 62 120 pht( 63 - "There is no way to undo this operation or ever retrieve this data.". 64 - "\n\n". 65 - "These %s object(s) will be **completely destroyed forever**:". 66 - "\n\n", 67 - new PhutilNumber(count($named_objects)))); 121 + 'These %s object(s) will be destroyed forever:', 122 + new PhutilNumber(count($named_objects)))."\n\n"); 68 123 69 124 foreach ($named_objects as $object_name => $object) { 125 + $phid = $object->getPHID(); 126 + 70 127 $console->writeOut( 71 - " - %s (%s)\n", 128 + " - %s (%s) %s\n", 72 129 $object_name, 73 - get_class($object)); 130 + get_class($object), 131 + $handles[$phid]->getFullName()); 74 132 } 75 133 76 134 $force = $args->getArg('force');
+11
src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
··· 1067 1067 ), 1068 1068 ), 1069 1069 1070 + 'These %s object(s) will be destroyed forever:' => array( 1071 + 'This object will be destroyed forever:', 1072 + 'These objects will be destroyed forever:', 1073 + ), 1074 + 1075 + 'Are you absolutely certain you want to destroy these %s '. 1076 + 'object(s)?' => array( 1077 + 'Are you absolutely certain you want to destroy this object?', 1078 + 'Are you absolutely certain you want to destroy these objects?', 1079 + ), 1080 + 1070 1081 ); 1071 1082 } 1072 1083