Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
2e48a0c8
Commit
2e48a0c8
authored
1 year ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
use session.gc_maxlifetime for session storage in cache, fixes #604
Closes #604 Merge request
studip/studip!1786
parent
27e1257a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/phplib/CT_Cache.class.php
+27
-15
27 additions, 15 deletions
lib/phplib/CT_Cache.class.php
with
27 additions
and
15 deletions
lib/phplib/CT_Cache.class.php
+
27
−
15
View file @
2e48a0c8
...
@@ -5,52 +5,64 @@
...
@@ -5,52 +5,64 @@
## PHPLIB Data Storage Container using Stud.IP cache
## PHPLIB Data Storage Container using Stud.IP cache
## for use with Stud.IP and cache only!
## for use with Stud.IP and cache only!
class
CT_Cache
{
class
CT_Cache
const
CACHE_KEY_PREFIX
=
'session_data'
;
{
const
SESSION_LIFETIME
=
7200
;
protected
const
CACHE_KEY_PREFIX
=
'session_data'
;
protected
const
SESSION_LIFETIME
=
7200
;
private
$cache
;
private
$cache
;
function
ac_start
()
{
public
function
ac_start
()
{
$this
->
cache
=
StudipCacheFactory
::
getCache
();
$this
->
cache
=
StudipCacheFactory
::
getCache
();
}
}
function
ac_get_lock
()
{
public
function
ac_get_lock
()
{
}
}
function
ac_release_lock
()
{
public
function
ac_release_lock
()
{
}
}
function
ac_newid
(
$str
,
$name
=
null
)
{
public
function
ac_newid
(
$str
,
$name
=
null
)
{
return
$this
->
ac_get_value
(
$str
)
===
false
?
$str
:
false
;
return
$this
->
ac_get_value
(
$str
)
===
false
?
$str
:
false
;
}
}
function
ac_store
(
$id
,
$name
,
$str
)
{
public
function
ac_store
(
$id
,
$name
,
$str
)
{
$cache_key
=
self
::
CACHE_KEY_PREFIX
.
'/'
.
$id
;
$cache_key
=
self
::
CACHE_KEY_PREFIX
.
'/'
.
$id
;
return
$this
->
cache
->
write
(
$cache_key
,
$str
,
self
::
SESSION_LIFETIME
);
return
$this
->
cache
->
write
(
$cache_key
,
$str
,
ini_get
(
'session.gc_maxlifetime'
)
?:
self
::
SESSION_LIFETIME
);
}
}
function
ac_delete
(
$id
,
$name
=
null
)
{
public
function
ac_delete
(
$id
,
$name
=
null
)
{
$cache_key
=
self
::
CACHE_KEY_PREFIX
.
'/'
.
$id
;
$cache_key
=
self
::
CACHE_KEY_PREFIX
.
'/'
.
$id
;
$this
->
cache
->
expire
(
$cache_key
);
$this
->
cache
->
expire
(
$cache_key
);
}
}
function
ac_gc
(
$gc_time
,
$name
=
null
)
{
public
function
ac_gc
(
$gc_time
,
$name
=
null
)
{
}
}
function
ac_halt
(
$s
)
{
public
function
ac_halt
(
$s
)
{
echo
"<b>
$s
</b>"
;
echo
"<b>
$s
</b>"
;
exit
;
exit
;
}
}
function
ac_get_value
(
$id
,
$name
=
null
)
{
public
function
ac_get_value
(
$id
,
$name
=
null
)
{
$cache_key
=
self
::
CACHE_KEY_PREFIX
.
'/'
.
$id
;
$cache_key
=
self
::
CACHE_KEY_PREFIX
.
'/'
.
$id
;
return
$this
->
cache
->
read
(
$cache_key
);
return
$this
->
cache
->
read
(
$cache_key
);
}
}
function
ac_get_changed
(
$id
,
$name
=
null
)
{
public
function
ac_get_changed
(
$id
,
$name
=
null
)
{
}
}
function
ac_set_changed
(
$id
,
$name
,
$timestamp
)
{
public
function
ac_set_changed
(
$id
,
$name
,
$timestamp
)
{
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment