| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | use Wikimedia\Rdbms\IReadableDatabase; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "DeleteUnknownPreferences" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface DeleteUnknownPreferencesHook { |
| 15 | /** |
| 16 | * This hook is called by the cleanupPreferences.php maintenance script |
| 17 | * to build a WHERE clause with which to delete preferences that are not |
| 18 | * known about. This hook is used by extensions that have dynamically-named |
| 19 | * preferences that should not be deleted in the usual cleanup process. |
| 20 | * For example, the Gadgets extension creates preferences prefixed with |
| 21 | * 'gadget-', so anything with that prefix is excluded from the deletion. |
| 22 | * |
| 23 | * @since 1.35 |
| 24 | * |
| 25 | * @param array &$where Array that will be passed as the $cond parameter to |
| 26 | * IReadableDatabase::select() to determine what will be deleted from the user_properties |
| 27 | * table |
| 28 | * @param IReadableDatabase $db IReadableDatabase object, |
| 29 | * useful for accessing $db->expr() to build expressions with IExpression::LIKE and LikeValue |
| 30 | * @return bool|void True or no return value to continue or false to abort |
| 31 | */ |
| 32 | public function onDeleteUnknownPreferences( &$where, $db ); |
| 33 | } |