本文整理汇总了PHP中ChamiloSession::setSession方法的典型用法代码示例。如果您正苦于以下问题:PHP ChamiloSession::setSession方法的具体用法?PHP ChamiloSession::setSession怎么用?PHP ChamiloSession::setSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChamiloSession
的用法示例。
在下文中一共展示了ChamiloSession::setSession方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onLogoutSuccess
/**
* @param Request $request
* @return null|RedirectResponse
*/
public function onLogoutSuccess(Request $request)
{
$session = $request->getSession();
\ChamiloSession::setSession($session);
// Chamilo logout
$userId = api_get_user_id();
\Online::logout($userId, false);
$login = $this->router->generate('index');
$response = new RedirectResponse($login);
return $response;
}
示例2: onSecuritySwitchUser
/**
* Fired on switch user, you can remove attributes or whatever you want here.
* @param SwitchUserEvent $event
*/
public function onSecuritySwitchUser(SwitchUserEvent $event)
{
/** @var \Entity\User $user */
$user = $event->getTargetUser();
/*var_dump($user );
var_dump($event->getRequest()->getUser());
*/
$request = $event->getRequest();
$session = $request->getSession();
\ChamiloSession::setSession($session);
$session = $event->getRequest()->getSession();
//$session->remove('partThatShouldNotCarryOver');
}
示例3: createApplication
/**
* @return \Symfony\Component\HttpKernel\HttpKernel
*/
public function createApplication()
{
// do not use require_once
$app = (require __DIR__ . '/../../main/inc/global.inc.php');
$app['debug'] = true;
$app['session.test'] = true;
$app['exception_handler']->disable();
// Setting session obj for old libraries
\ChamiloSession::setSession($app['session']);
\UserManager::setEntityManager($app['orm.em']);
//$app['monolog'] = $this->getMock('Monolog\Logger');
return $app;
}
示例4:
$app->abort(500, "data/temp folder must be writable.");
}
// Checking that configuration is loaded
if (!isset($app['configuration'])) {
$app->abort(500, '$configuration array must be set in the configuration.php file.');
}
$configuration = $app['configuration'];
// Check if root_web exists
if (!isset($configuration['root_web'])) {
$app->abort(500, '$configuration[root_web] must be set in the configuration.php file.');
}
// Starting the session for more info see: http://silex.sensiolabs.org/doc/providers/session.html
$session = $request->getSession();
$session->start();
// Setting session obj
Session::setSession($session);
UserManager::setEntityManager($app['orm.em']);
/** @var ChamiloLMS\Component\DataFilesystem\DataFilesystem $filesystem */
$filesystem = $app['chamilo.filesystem'];
if ($app['debug']) {
// Creates data/temp folders for every request if debug is on.
$filesystem->createFolders($app['temp.paths']->folders);
}
// If Assetic is enabled copy folders from theme inside "web/"
if ($app['assetic.auto_dump_assets']) {
$filesystem->copyFolders($app['temp.paths']->copyFolders);
}
// Check and modify the date of user in the track.e.online table
Online::loginCheck(api_get_user_id());
// Setting access_url id (multiple url feature)
if (api_get_multiple_access_url()) {