| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Session\Hook; |
| 4 | |
| 5 | use MediaWiki\Request\WebRequest; |
| 6 | use MediaWiki\Session\SessionBackend; |
| 7 | |
| 8 | /** |
| 9 | * This is a hook handler interface, see docs/Hooks.md. |
| 10 | * Use the hook name "SessionMetadata" to register handlers implementing this interface. |
| 11 | * |
| 12 | * @stable to implement |
| 13 | * @ingroup Hooks |
| 14 | */ |
| 15 | interface SessionMetadataHook { |
| 16 | /** |
| 17 | * Use this hook to add metadata to a session being saved. |
| 18 | * |
| 19 | * @since 1.35 |
| 20 | * |
| 21 | * @param SessionBackend $backend MediaWiki\Session\SessionBackend being saved |
| 22 | * @param array &$metadata Metadata to be stored. Add new keys here. |
| 23 | * @param WebRequest[] $requests Array of WebRequests potentially being |
| 24 | * saved to. Generally 0-1 real request and 0+ FauxRequests. |
| 25 | * @return bool|void True or no return value to continue or false to abort |
| 26 | */ |
| 27 | public function onSessionMetadata( $backend, &$metadata, $requests ); |
| 28 | } |