Allow extensions to run hooks *before* an object is destroyed.
This would easily allow to do things like:
- Before you actually destroy a profile picture, find its active usages and set the builtin profile image. This is our core need to be able to fix T16074.
- Before you actually destroy something at midnight, allow extensions to throw violently and effectively impede destruction saying for example "please go to sleep first" in the exception message, visible from command line. This specific thing is not currently required but theoretically works.
- Before you actually destroy a generic object, you can still query its dependent items, before the destruction of the object. This is particularly useful if you want to use Query methods, which often require a fully functioning parent object. This last specific thing is not currently required but theoretically works.
- Before you actually destroy a generic object, you can still destroy something else using the PhabricatorDestructionEngine. This last specific thing is not currently required but theoretically works.
This new engine is to be considered unstable.
If you implement this class please contact Phorge at T16079 even if the task is closed.
Closes T16079
Ref T16074