Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-tool_lifecycle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-tool_lifecycle
Commits
366c2119
Unverified
Commit
366c2119
authored
8 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Added pre and post processing operations
parent
74e7627f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes/task/process_cleanup.php
+14
-0
14 additions, 0 deletions
classes/task/process_cleanup.php
step/lib.php
+18
-0
18 additions, 0 deletions
step/lib.php
with
32 additions
and
0 deletions
classes/task/process_cleanup.php
+
14
−
0
View file @
366c2119
...
...
@@ -23,6 +23,9 @@
*/
namespace
tool_cleanupcourses
;
use
tool_cleanupcourses\manager\lib_manager
;
use
tool_cleanupcourses\manager\step_manager
;
defined
(
'MOODLE_INTERNAL'
)
||
die
;
class
process_cleanup
extends
\core\task\scheduled_task
{
...
...
@@ -34,6 +37,17 @@ class process_cleanup extends \core\task\scheduled_task {
public
function
execute
()
{
$processor
=
new
cleanup_processor
();
$processor
->
call_trigger
();
$steps
=
step_manager
::
get_step_types
();
/** @var \tool_cleanupcourses\step\base[] $steplibs stores the lib classes of all step subplugins.*/
$steplibs
=
array
();
foreach
(
$steps
as
$id
=>
$step
)
{
$steplibs
[
$id
]
=
lib_manager
::
get_step_lib
(
$id
);
$steplibs
[
$id
]
->
pre_processing_bulk_operation
();
}
$processor
->
process_courses
();
foreach
(
$steps
as
$id
=>
$step
)
{
$steplibs
[
$id
]
->
post_processing_bulk_operation
();
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
step/lib.php
+
18
−
0
View file @
366c2119
...
...
@@ -45,6 +45,24 @@ abstract class base {
*/
public
abstract
function
process_course
(
$instanceid
,
$course
);
/**
* Can be overridden to define actions to take place before
* process_course() is called for every relevant course.
*/
public
function
pre_processing_bulk_operation
()
{
}
/**
* Can be overridden to define actions to take place after
* process_course() is called for every relevant course.
*/
public
function
post_processing_bulk_operation
()
{
}
/**
* The return value should be equivalent with the name of the subplugin folder.
* @return string technical name of the subplugin
*/
public
abstract
function
get_subpluginname
();
/**
...
...
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