3 namespace BookStack\Theming;
6 * The ThemeEvents used within BookStack.
8 * This file details the events that BookStack may fire via the custom
9 * theme system, including event names, parameters and expected return types.
11 * This system is regarded as semi-stable.
12 * We'll look to fix issues with it or migrate old event types but
13 * events and their signatures may change in new versions of BookStack.
14 * We'd advise testing any usage of these events upon upgrade.
19 * Application boot-up.
20 * After main services are registered.
22 * @param \BookStack\Application $app
24 const APP_BOOT = 'app_boot';
27 * Web before middleware action.
28 * Runs before the request is handled but after all other middleware apart from those
29 * that depend on the current session user (Localization for example).
30 * Provides the original request to use.
31 * Return values, if provided, will be used as a new response to use.
33 * @param \Illuminate\Http\Request $request
34 * @returns \Illuminate\Http\Response|null
36 const WEB_MIDDLEWARE_BEFORE = 'web_middleware_before';
39 * Web after middleware action.
40 * Runs after the request is handled but before the response is sent.
41 * Provides both the original request and the currently resolved response.
42 * Return values, if provided, will be used as a new response to use.
44 * @param \Illuminate\Http\Request $request
45 * @param \Illuminate\Http\Response|Symfony\Component\HttpFoundation\BinaryFileResponse $response
46 * @returns \Illuminate\Http\Response|null
48 const WEB_MIDDLEWARE_AFTER = 'web_middleware_after';
52 * Runs right after a user is logged-in to the application by any authentication
53 * system as a standard app user. This includes a user becoming logged in
54 * after registration. This is not emitted upon API usage.
56 * @param string $authSystem
57 * @param \BookStack\Auth\User $user
59 const AUTH_LOGIN = 'auth_login';
62 * Auth register event.
63 * Runs right after a user is newly registered to the application by any authentication
64 * system as a standard app user. This includes auto-registration systems used
65 * by LDAP, SAML and social systems. It only includes self-registrations.
67 * @param string $authSystem
68 * @param \BookStack\Auth\User $user
70 const AUTH_REGISTER = 'auth_register';
73 * Commonmark environment configure.
74 * Provides the commonmark library environment for customization
75 * before its used to render markdown content.
76 * If the listener returns a non-null value, that will be used as an environment instead.
78 * @param \League\CommonMark\ConfigurableEnvironmentInterface $environment
79 * @returns \League\CommonMark\ConfigurableEnvironmentInterface|null
81 const COMMONMARK_ENVIRONMENT_CONFIGURE = 'commonmark_environment_configure';