Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
9859e26c
Commit
9859e26c
authored
Jul 24, 2008
by
jamiesensei
Browse files
MDL-14208 "add cron routine to clean up cache records"
parent
d1789d5d
Changes
3
Hide whitespace changes
Inline
Side-by-side
mod/quiz/report/statistics/cron.php
0 → 100644
View file @
9859e26c
<?php
// $Id$
function
quiz_report_statistics_cron
(){
global
$DB
;
if
(
$todelete
=
$DB
->
get_records_select_menu
(
'quiz_statistics'
,
'timemodified < ?'
,
array
(
time
()
-
5
*
HOURSECS
))){
list
(
$todeletesql
,
$todeleteparams
)
=
$DB
->
get_in_or_equal
(
$todelete
);
if
(
!
$DB
->
delete_records_select
(
'quiz_statistics'
,
"id
$todeletesql
"
,
$todeleteparams
)){
mtrace
(
'Error deleting out of date quiz_statistics records.'
);
}
if
(
!
$DB
->
delete_records_select
(
'quiz_question_statistics'
,
"quizstatisticsid
$todeletesql
"
,
$todeleteparams
)){
mtrace
(
'Error deleting out of date quiz_question_statistics records.'
);
}
}
return
true
;
}
?>
mod/quiz/report/statistics/db/upgrade.php
0 → 100644
View file @
9859e26c
<?php
// $Id$
function
xmldb_quizreport_statistics_upgrade
(
$oldversion
=
0
)
{
global
$DB
;
$dbman
=
$DB
->
get_manager
();
$result
=
true
;
//===== 1.9.0 upgrade line ======//
if
(
$result
&&
$oldversion
<
2008072401
)
{
//register cron to run every 5 hours.
$result
=
$result
&&
$DB
->
set_field
(
'quiz_report'
,
'cron'
,
HOURSECS
*
5
,
array
(
'name'
=>
'statistics'
));
}
return
$result
;
}
?>
mod/quiz/report/statistics/version.php
View file @
9859e26c
<?php
$plugin
->
version
=
200807240
0
;
// The (date) version of this module
$plugin
->
version
=
200807240
1
;
// The (date) version of this module
?>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment