*/
public static function init(string $name, int $cookieLifetime = 72576000): bool
{
$proceeded = false;
if (session_status() === PHP_SESSION_NONE) {
session_name($name);
session_set_cookie_params($cookieLifetime);
ini_set('session.gc_maxlifetime', $cookieLifetime);
ini_set('session.cookie_lifetime', $cookieLifetime);
session_start();
if (session_status() === PHP_SESSION_DISABLED) {
$message .= 'because its disabled. If you want to use flash mesages, enable sessions first';
$sessionAvailable = false;
} elseif (session_status() === PHP_SESSION_NONE) {
$sessionName = "{$projectName}_$context";
SessionUtils::init($sessionName);
}
if (!$sessionAvailable) {
throw new MissingDataException($message);
}
*
* @return \Radar\EventSubscriber\SurveyEventSubscriber
*/
protected function getSurveyEventSubscriberService()
{
return $this->services['Radar\\EventSubscriber\\SurveyEventSubscriber'] = new \Radar\EventSubscriber\SurveyEventSubscriber(($this->services['Radar\\BaseVarMaker\\BaseVarMaker'] ?? $this->getBaseVarMakerService()), ($this->services['Radar\\Flash\\FlashBag'] ?? ($this->services['Radar\\Flash\\FlashBag'] = new \Radar\Flash\FlashBag('A20-45', 'survey'))), ($this->services['Monolog\\Logger'] ?? $this->getLoggerService()), '/var/www/radar/data/www/radar-survey.ru/A20-45/json_question_schema', 'dev');
}
/**
* Gets the public 'Radar\EventSubscriber\ToggleEnvSubscriber' shared autowired service.
*
}, 1 => 'onKernelException']);
$instance->addListener('system.add_vars_to_base', [0 => function () {
return ($this->services['Radar\\EventSubscriber\\SurveyEventSubscriber'] ?? $this->getSurveyEventSubscriberService());
}, 1 => 'addVarsToBase']);
$instance->addListener('system.reset.cache', [0 => function () {
return ($this->services['Radar\\EventSubscriber\\SurveyEventSubscriber'] ?? $this->getSurveyEventSubscriberService());
}, 1 => 'resetCache']);
$instance->addListener('system.on.updateDataset', [0 => function () {
return ($this->services['Radar\\EventSubscriber\\SurveyEventSubscriber'] ?? $this->getSurveyEventSubscriberService());
}, 1 => 'addVarsToBase'], 200);
$instance->addListener('system.on.updateDataset', [0 => function () {
foreach ($listeners as &$listener) {
$closure = &$this->optimized[$eventName][];
if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
$closure = static function (...$args) use (&$listener, &$closure) {
if ($listener[0] instanceof \Closure) {
$listener[0] = $listener[0]();
$listener[1] = $listener[1] ?? '__invoke';
}
($closure = \Closure::fromCallable($listener))(...$args);
};
} else {
use Radar\Event\ResetCacheEvent;
/* Always reset cache if env is dev */
if ($container->getParameter('project.env') === 'dev') {
$resetCacheEvent = new ResetCacheEvent($container->get('fileCache'), $container->get('projectCache'));
$dispatcher->dispatch($resetCacheEvent, $resetCacheEvent::NAME);
$resetTwigCacheEvent = new ForceResetTwigCacheEvent($container->getParameter('twig.path_to_compilation_cache'));
$dispatcher->dispatch($resetTwigCacheEvent, $resetTwigCacheEvent::NAME);
}
$errorHadler->setDefaultLogger($logger);
ErrorHandler::register($errorHadler);
}
/* End error handling */
require 'init.php';
$matcher = new UrlMatcher($routes, new RequestContext());
$dispatcher->addSubscriber(new RouterListener($matcher, new RequestStack()));
$kernel = $container->get('http_kernel');
ErrorException |
---|
ErrorException: Warning: session_name(): Session name cannot be changed after headers have already been sent at /var/www/radar/data/www/radar-survey.ru/A20-45/src/Radar/Utils/SessionUtils.php:23 at Radar\Utils\SessionUtils::init() (/var/www/radar/data/www/radar-survey.ru/A20-45/src/Radar/Flash/FlashBag.php:39) at Radar\Flash\FlashBag->__construct() (/var/www/radar/data/www/radar-survey.ru/A20-45/tmp/dumpedContainer_survey.php:296) at ProjectSurveyContainer->getSurveyEventSubscriberService() (/var/www/radar/data/www/radar-survey.ru/A20-45/tmp/dumpedContainer_survey.php:495) at ProjectSurveyContainer->{closure}() (/var/www/radar/data/www/radar-survey.ru/A20-45/vendor/symfony/event-dispatcher/EventDispatcher.php:267) at Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}() (/var/www/radar/data/www/radar-survey.ru/A20-45/vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/var/www/radar/data/www/radar-survey.ru/A20-45/vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/var/www/radar/data/www/radar-survey.ru/A20-45/init.php:9) at require('/var/www/radar/data/www/radar-survey.ru/A20-45/init.php') (/var/www/radar/data/www/radar-survey.ru/A20-45/index.php:47) |