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