mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Add options in module.xml to disable session and Cache-Control headers for individual actions
This commit is contained in:
parent
3722c49750
commit
ec36839303
3 changed files with 18 additions and 4 deletions
|
|
@ -366,11 +366,17 @@ class Context
|
|||
// start session
|
||||
if (\PHP_SAPI !== 'cli')
|
||||
{
|
||||
Rhymix\Framework\Session::checkSSO($site_module_info);
|
||||
Rhymix\Framework\Session::start(false);
|
||||
if (!session_cache_limiter())
|
||||
if (!isset(self::$_route_info->session) || self::$_route_info->session)
|
||||
{
|
||||
self::setCacheControl(0);
|
||||
Rhymix\Framework\Session::checkSSO($site_module_info);
|
||||
Rhymix\Framework\Session::start(false);
|
||||
}
|
||||
if (!isset(self::$_route_info->cache_control) || self::$_route_info->cache_control)
|
||||
{
|
||||
if (!session_cache_limiter())
|
||||
{
|
||||
self::setCacheControl(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,6 +127,8 @@ class Router
|
|||
$result->mid = '';
|
||||
$result->act = '';
|
||||
$result->forwarded = false;
|
||||
$result->session = true;
|
||||
$result->cache_control = true;
|
||||
$result->args = array();
|
||||
|
||||
// Separate additional arguments from the URL.
|
||||
|
|
@ -181,6 +183,8 @@ class Router
|
|||
$allargs = array_merge($args, [$prefix_type => $prefix]);
|
||||
$result->module = $module_name;
|
||||
$result->mid = $prefix;
|
||||
$result->session = ($action_info->action->{$action_info->default_index_act}->session === 'false') ? false : true;
|
||||
$result->cache_control = ($action_info->action->{$action_info->default_index_act}->cache_control === 'false') ? false : true;
|
||||
$result->args = $allargs;
|
||||
return $result;
|
||||
}
|
||||
|
|
@ -195,6 +199,8 @@ class Router
|
|||
$result->module = $module_name;
|
||||
$result->mid = $prefix_type === 'mid' ? $prefix : '';
|
||||
$result->act = $action;
|
||||
$result->session = ($action_info->action->{$action}->session === 'false') ? false : true;
|
||||
$result->cache_control = ($action_info->action->{$action}->cache_control === 'false') ? false : true;
|
||||
$result->args = $allargs;
|
||||
return $result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,6 +190,8 @@ class ModuleActionParser extends BaseParser
|
|||
$action_info->standalone = $standalone;
|
||||
$action_info->check_csrf = self::_getAttributeString($action, 'check-csrf') === 'false' ? 'false' : 'true';
|
||||
$action_info->meta_noindex = self::_getAttributeString($action, 'meta-noindex') === 'true' ? 'true' : 'false';
|
||||
$action_info->session = self::_getAttributeString($action, 'session') === 'false' ? 'false' : 'true';
|
||||
$action_info->cache_control = self::_getAttributeString($action, 'cache-control') === 'false' ? 'false' : 'true';
|
||||
$action_info->global_route = $global_route;
|
||||
$info->action->{$action_name} = $action_info;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue