public function getGlobals()
{
/** @var \Bolt\Config $config */
$config = $this->app['config'];
$configVal = $this->safe ? null : $config;
/** @var \Bolt\Users $users */
$users = $this->app['users'];
/** @var \Bolt\Configuration\ResourceManager $resources */
$resources = $this->app['resources'];
$zone = null;
/** @var RequestStack $requestStack */
$requestStack = $this->app['request_stack'];
if ($request = $requestStack->getCurrentRequest()) {
$zone = Zone::get($request);
}
// User calls can cause exceptions that block the exception handler
try {
/** @deprecated Deprecated since 3.0, to be removed in 4.0. */
$usersVal = $this->safe ? null : $users->getUsers();
$usersCur = $users->getCurrentUser();
} catch (\Exception $e) {
$usersVal = null;
$usersCur = null;
}
// Structured to allow PHPStorm's SymfonyPlugin to provide code completion
return ['bolt_name' => Bolt\Version::name(), 'bolt_version' => Bolt\Version::VERSION, 'bolt_stable' => Bolt\Version::isStable(), 'frontend' => $zone === Zone::FRONTEND, 'backend' => $zone === Zone::BACKEND, 'async' => $zone === Zone::ASYNC, 'paths' => $resources->getPaths(), 'theme' => $config->get('theme'), 'user' => $usersCur, 'users' => $usersVal, 'config' => $configVal];
}