Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core\task\task_base Class Reference

Abstract class for common properties of scheduled_task and adhoc_task. More...

Inheritance diagram for core\task\task_base:
core\task\adhoc_task core\task\scheduled_task assignfeedback_editpdf\task\bump_submission_for_stale_conversions assignfeedback_editpdf\task\convert_submission assignfeedback_editpdf\task\remove_orphaned_editpdf_files auth_ldap\task\asynchronous_sync_task cachestore_file\task\asyncpurge core\task\asynchronous_backup_task core\task\asynchronous_copy_task core\task\asynchronous_restore_task core\task\badges_adhoc_task core\task\build_installed_themes_task core\task\calendar_fix_orphaned_events core\task\clean_up_deleted_search_area_task core\task\course_backup_task core\task\fix_file_timestamps_task core\task\refresh_mod_calendar_events_task core\task\send_login_notifications core_communication\task\add_members_to_room_task core_communication\task\create_and_configure_room_task core_communication\task\delete_room_task core_communication\task\remove_members_from_room core_communication\task\synchronise_provider_task core_communication\task\update_room_membership_task core_communication\task\update_room_task core_course\task\content_notification_task core_course\task\course_delete_modules core_message\task\migrate_message_data core_reportbuilder\task\send_schedule enrol_lti\local\ltiadvantage\task\sync_tool_grades mod_bigbluebuttonbn\task\base_send_notification mod_bigbluebuttonbn\task\completion_update_state mod_bigbluebuttonbn\task\reset_recordings mod_bigbluebuttonbn\task\send_bigbluebutton_module_disabled_notification mod_bigbluebuttonbn\task\send_notification mod_bigbluebuttonbn\task\upgrade_recordings_task mod_forum\task\send_user_digests mod_forum\task\send_user_notifications mod_scorm\task\update_grades quiz_statistics\task\recalculate tool_langimport\task\install_langpacks tool_monitor\notification_task tool_moodlenet\task\post_install tool_moodlenet\task\send_enable_notification tool_moodlenet\task\send_mnet_profiles_data_removed_notification auth_cas\task\sync_task auth_db\task\sync_users auth_ldap\task\sync_roles auth_ldap\task\sync_task auth_mnet\task\cron_task block_recent_activity\task\cleanup block_rss_client\task\refreshfeeds cachestore_redis\task\ttl core\oauth2\refresh_system_tokens_task core\task\analytics_cleanup_task core\task\antivirus_cleanup_task core\task\automated_backup_report_task core\task\automated_backup_task core\task\badges_cron_task core\task\badges_message_task core\task\blog_cron_task core\task\cache_cleanup_task core\task\cache_cron_task core\task\calendar_cron_task core\task\check_for_updates_task core\task\complete_plans_task core\task\completion_daily_task core\task\completion_regular_task core\task\context_cleanup_task core\task\create_contexts_task core\task\delete_incomplete_users_task core\task\delete_unconfirmed_users_task core\task\file_temp_cleanup_task core\task\file_trash_cleanup_task core\task\grade_cron_task core\task\grade_history_cleanup_task core\task\h5p_clean_orphaned_records_task core\task\h5p_get_content_types_task core\task\messaging_cleanup_task core\task\password_reset_cleanup_task core\task\plagiarism_cron_task core\task\portfolio_cron_task core\task\question_preview_cleanup_task core\task\registration_cron_task core\task\search_index_task core\task\search_optimize_task core\task\send_failed_login_notifications_task core\task\send_new_user_passwords_task core\task\session_cleanup_task core\task\show_started_courses_task core\task\stats_cron_task core\task\sync_plans_from_template_cohorts_task core\task\tag_cron_task core\task\task_lock_cleanup_task core\task\task_log_cleanup_task core_communication\task\synchronise_providers_task core_files\task\conversion_cleanup_task core_reportbuilder\task\send_schedules core_xapi\task\state_cleanup_task editor_atto\task\autosave_cleanup_task enrol_category\task\enrol_category_sync enrol_cohort\task\enrol_cohort_sync enrol_database\task\sync_enrolments enrol_flatfile\task\flatfile_sync_task enrol_imsenterprise\task\cron_task enrol_ldap\task\sync_enrolments enrol_lti\local\ltiadvantage\task\sync_grades enrol_lti\local\ltiadvantage\task\sync_members enrol_lti\task\sync_grades enrol_lti\task\sync_members enrol_manual\task\send_expiry_notifications enrol_manual\task\sync_enrolments enrol_meta\task\enrol_meta_sync enrol_paypal\task\process_expirations enrol_self\task\send_expiry_notifications enrol_self\task\sync_enrolments factor_grace\task\revoke_expired_factors factor_nosetup\task\delete_unusable_factors logstore_standard\task\cleanup_task ltiservice_gradebookservices\task\cleanup_task message_email\task\send_email_task mod_assign\task\cron_task mod_bigbluebuttonbn\task\check_dismissed_recordings mod_bigbluebuttonbn\task\check_pending_recordings mod_chat\task\cron_task mod_forum\task\cron_task mod_lti\task\clean_access_tokens mod_quiz\task\quiz_notify_attempt_manual_grading_completed mod_quiz\task\update_overdue_attempts mod_scorm\task\cron_task mod_workshop\task\cron_task repository_dropbox\task\cron_task repository_filesystem\task\cron_task repository_onedrive\remove_temp_access_task tool_analytics\task\predict_models tool_analytics\task\train_models tool_brickfield\task\bulk_process_caches tool_brickfield\task\bulk_process_courses tool_brickfield\task\checkid_validation tool_brickfield\task\process_analysis_requests tool_brickfield\task\update_summarydata tool_cohortroles\task\cohort_role_sync tool_dataprivacy\task\delete_existing_deleted_users tool_dataprivacy\task\delete_expired_contexts tool_dataprivacy\task\delete_expired_requests tool_dataprivacy\task\expired_retention_period tool_langimport\task\update_langpacks_task tool_messageinbound\task\cleanup_task tool_messageinbound\task\pickup_task tool_monitor\task\check_subscriptions tool_monitor\task\clean_events tool_recyclebin\task\cleanup_category_bin tool_recyclebin\task\cleanup_course_bin tool_task\scheduled_checker_task workshopallocation_scheduled\task\cron_task

Public Member Functions

 execute ()
 Do the job.
 
 get_component ()
 Getter for $component.
 
 get_cron_lock ()
 Get the current lock for the entire cron.
 
 get_fail_delay ()
 Getter for $faildelay.
 
 get_hostname ()
 Getter for $hostname.
 
 get_lock ()
 Get the current lock for this task.
 
 get_name ()
 Get a descriptive name for the task (shown to admins)
 
 get_next_run_time ()
 Get the next run time for this task.
 
 get_pid ()
 Getter for $pid.
 
 get_runtime ()
 Returns task runtime.
 
 get_runtime_result ()
 Returns if the task has been running for too long.
 
 get_timestarted ()
 Getter for $timestarted.
 
replacement is_blocking ()
 
 is_component_enabled ()
 Informs whether the task's component is enabled.
 
replacement set_blocking ($blocking)
 
 set_component ($component)
 Setter for $component.
 
 set_cron_lock (\core\lock\lock $lock)
 Set the current lock for the entire cron process.
 
 set_fail_delay ($faildelay)
 Setter for $faildelay.
 
 set_hostname ($hostname=null)
 Setter for $hostname.
 
 set_lock (\core\lock\lock $lock)
 Set the current lock for this task.
 
 set_next_run_time ($nextruntime)
 Set the next run time for this task.
 
 set_pid ($pid=null)
 Setter for $pid.
 
 set_timestarted ($timestarted=null)
 Setter for $timestarted.
 

Public Attributes

replacement : null
 Setter for $blocking.
 
replacement : null
 Getter for $blocking.
 
replacement reason: 'Blocking tasks are no longer supported'
 
replacement since: '4.4'
 

Detailed Description

Abstract class for common properties of scheduled_task and adhoc_task.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ execute()

core\task\task_base::execute ( )
abstract

Do the job.

Throw exceptions on errors (the job will be retried).

Reimplemented in assignfeedback_editpdf\task\bump_submission_for_stale_conversions, assignfeedback_editpdf\task\convert_submission, assignfeedback_editpdf\task\remove_orphaned_editpdf_files, auth_cas\task\sync_task, auth_db\task\sync_users, auth_ldap\task\asynchronous_sync_task, auth_ldap\task\sync_roles, auth_ldap\task\sync_task, auth_mnet\task\cron_task, block_recent_activity\task\cleanup, block_rss_client\task\refreshfeeds, cachestore_file\task\asyncpurge, cachestore_redis\task\ttl, core\oauth2\refresh_system_tokens_task, core\task\analytics_cleanup_task, core\task\antivirus_cleanup_task, core\task\asynchronous_backup_task, core\task\asynchronous_copy_task, core\task\asynchronous_restore_task, core\task\automated_backup_report_task, core\task\automated_backup_task, core\task\badges_adhoc_task, core\task\badges_cron_task, core\task\badges_message_task, core\task\blog_cron_task, core\task\build_installed_themes_task, core\task\cache_cleanup_task, core\task\cache_cron_task, core\task\calendar_cron_task, core\task\calendar_fix_orphaned_events, core\task\check_for_updates_task, core\task\clean_up_deleted_search_area_task, core\task\complete_plans_task, core\task\completion_daily_task, core\task\completion_regular_task, core\task\context_cleanup_task, core\task\course_backup_task, core\task\create_contexts_task, core\task\delete_incomplete_users_task, core\task\delete_unconfirmed_users_task, core\task\file_temp_cleanup_task, core\task\file_trash_cleanup_task, core\task\fix_file_timestamps_task, core\task\grade_cron_task, core\task\grade_history_cleanup_task, core\task\h5p_clean_orphaned_records_task, core\task\h5p_get_content_types_task, core\task\messaging_cleanup_task, core\task\password_reset_cleanup_task, core\task\plagiarism_cron_task, core\task\portfolio_cron_task, core\task\question_preview_cleanup_task, core\task\refresh_mod_calendar_events_task, core\task\registration_cron_task, core\task\search_index_task, core\task\search_optimize_task, core\task\send_failed_login_notifications_task, core\task\send_login_notifications, core\task\send_new_user_passwords_task, core\task\session_cleanup_task, core\task\show_started_courses_task, core\task\stats_cron_task, core\task\sync_plans_from_template_cohorts_task, core\task\tag_cron_task, core\task\task_lock_cleanup_task, core\task\task_log_cleanup_task, core_communication\task\add_members_to_room_task, core_communication\task\create_and_configure_room_task, core_communication\task\delete_room_task, core_communication\task\remove_members_from_room, core_communication\task\synchronise_provider_task, core_communication\task\synchronise_providers_task, core_communication\task\update_room_membership_task, core_communication\task\update_room_task, core_course\task\content_notification_task, core_course\task\course_delete_modules, core_files\task\conversion_cleanup_task, core_message\task\migrate_message_data, core_reportbuilder\task\send_schedule, core_reportbuilder\task\send_schedules, core_xapi\task\state_cleanup_task, editor_atto\task\autosave_cleanup_task, enrol_category\task\enrol_category_sync, enrol_cohort\task\enrol_cohort_sync, enrol_database\task\sync_enrolments, enrol_flatfile\task\flatfile_sync_task, enrol_imsenterprise\task\cron_task, enrol_ldap\task\sync_enrolments, enrol_lti\local\ltiadvantage\task\sync_grades, enrol_lti\local\ltiadvantage\task\sync_members, enrol_lti\local\ltiadvantage\task\sync_tool_grades, enrol_lti\task\sync_grades, enrol_lti\task\sync_members, enrol_manual\task\send_expiry_notifications, enrol_manual\task\sync_enrolments, enrol_meta\task\enrol_meta_sync, enrol_paypal\task\process_expirations, enrol_self\task\send_expiry_notifications, enrol_self\task\sync_enrolments, factor_grace\task\revoke_expired_factors, factor_nosetup\task\delete_unusable_factors, logstore_standard\task\cleanup_task, ltiservice_gradebookservices\task\cleanup_task, message_email\task\send_email_task, mod_assign\task\cron_task, mod_bigbluebuttonbn\task\base_send_notification, mod_bigbluebuttonbn\task\check_dismissed_recordings, mod_bigbluebuttonbn\task\check_pending_recordings, mod_bigbluebuttonbn\task\completion_update_state, mod_bigbluebuttonbn\task\reset_recordings, mod_bigbluebuttonbn\task\send_bigbluebutton_module_disabled_notification, mod_bigbluebuttonbn\task\send_notification, mod_bigbluebuttonbn\task\upgrade_recordings_task, mod_chat\task\cron_task, mod_forum\task\cron_task, mod_forum\task\send_user_digests, mod_forum\task\send_user_notifications, mod_lti\task\clean_access_tokens, mod_quiz\task\quiz_notify_attempt_manual_grading_completed, mod_quiz\task\update_overdue_attempts, mod_scorm\task\cron_task, mod_scorm\task\update_grades, mod_workshop\task\cron_task, quiz_statistics\task\recalculate, repository_dropbox\task\cron_task, repository_filesystem\task\cron_task, repository_onedrive\remove_temp_access_task, tool_analytics\task\predict_models, tool_analytics\task\train_models, tool_brickfield\task\bulk_process_caches, tool_brickfield\task\bulk_process_courses, tool_brickfield\task\checkid_validation, tool_brickfield\task\process_analysis_requests, tool_brickfield\task\update_summarydata, tool_cohortroles\task\cohort_role_sync, tool_dataprivacy\task\delete_existing_deleted_users, tool_dataprivacy\task\delete_expired_contexts, tool_dataprivacy\task\delete_expired_requests, tool_dataprivacy\task\expired_retention_period, tool_langimport\task\install_langpacks, tool_langimport\task\update_langpacks_task, tool_messageinbound\task\cleanup_task, tool_messageinbound\task\pickup_task, tool_monitor\notification_task, tool_monitor\task\check_subscriptions, tool_monitor\task\clean_events, tool_moodlenet\task\post_install, tool_moodlenet\task\send_enable_notification, tool_moodlenet\task\send_mnet_profiles_data_removed_notification, tool_recyclebin\task\cleanup_category_bin, tool_recyclebin\task\cleanup_course_bin, tool_task\scheduled_checker_task, and workshopallocation_scheduled\task\cron_task.

◆ get_component()

core\task\task_base::get_component ( )

Getter for $component.

Return values
string

◆ get_cron_lock()

core\task\task_base::get_cron_lock ( )

Get the current lock for the entire cron.

Return values
core\lock\lock

◆ get_fail_delay()

core\task\task_base::get_fail_delay ( )

Getter for $faildelay.

Return values
int

◆ get_hostname()

core\task\task_base::get_hostname ( )

Getter for $hostname.

Return values
string

◆ get_lock()

core\task\task_base::get_lock ( )

Get the current lock for this task.

Return values
core\lock\lock

◆ get_name()

core\task\task_base::get_name ( )
abstract

Get a descriptive name for the task (shown to admins)

Return values
string

Reimplemented in auth_cas\task\sync_task, auth_db\task\sync_users, auth_ldap\task\sync_roles, auth_ldap\task\sync_task, auth_mnet\task\cron_task, block_recent_activity\task\cleanup, block_rss_client\task\refreshfeeds, cachestore_redis\task\ttl, core\oauth2\refresh_system_tokens_task, core\task\adhoc_task, core\task\analytics_cleanup_task, core\task\antivirus_cleanup_task, core\task\automated_backup_report_task, core\task\automated_backup_task, core\task\badges_adhoc_task, core\task\badges_cron_task, core\task\badges_message_task, core\task\blog_cron_task, core\task\cache_cleanup_task, core\task\cache_cron_task, core\task\calendar_cron_task, core\task\check_for_updates_task, core\task\complete_plans_task, core\task\completion_daily_task, core\task\completion_regular_task, core\task\context_cleanup_task, core\task\create_contexts_task, core\task\delete_incomplete_users_task, core\task\delete_unconfirmed_users_task, core\task\file_temp_cleanup_task, core\task\file_trash_cleanup_task, core\task\grade_cron_task, core\task\grade_history_cleanup_task, core\task\h5p_clean_orphaned_records_task, core\task\h5p_get_content_types_task, core\task\hide_ended_courses_task, core\task\messaging_cleanup_task, core\task\password_reset_cleanup_task, core\task\plagiarism_cron_task, core\task\portfolio_cron_task, core\task\question_preview_cleanup_task, core\task\registration_cron_task, core\task\search_index_task, core\task\search_optimize_task, core\task\send_failed_login_notifications_task, core\task\send_new_user_passwords_task, core\task\session_cleanup_task, core\task\show_started_courses_task, core\task\stats_cron_task, core\task\sync_plans_from_template_cohorts_task, core\task\tag_cron_task, core\task\task_lock_cleanup_task, core\task\task_log_cleanup_task, core_communication\task\synchronise_providers_task, core_files\task\conversion_cleanup_task, core_reportbuilder\task\send_schedule, core_reportbuilder\task\send_schedules, core_xapi\task\state_cleanup_task, editor_atto\task\autosave_cleanup_task, enrol_category\task\enrol_category_sync, enrol_cohort\task\enrol_cohort_sync, enrol_database\task\sync_enrolments, enrol_flatfile\task\flatfile_sync_task, enrol_imsenterprise\task\cron_task, enrol_ldap\task\sync_enrolments, enrol_lti\local\ltiadvantage\task\sync_grades, enrol_lti\local\ltiadvantage\task\sync_members, enrol_lti\task\sync_grades, enrol_lti\task\sync_members, enrol_manual\task\send_expiry_notifications, enrol_manual\task\sync_enrolments, enrol_meta\task\enrol_meta_sync, enrol_paypal\task\process_expirations, enrol_self\task\send_expiry_notifications, enrol_self\task\sync_enrolments, factor_grace\task\revoke_expired_factors, factor_nosetup\task\delete_unusable_factors, logstore_standard\task\cleanup_task, ltiservice_gradebookservices\task\cleanup_task, message_email\task\send_email_task, mod_assign\task\cron_task, mod_bigbluebuttonbn\task\check_dismissed_recordings, mod_bigbluebuttonbn\task\check_pending_recordings, mod_chat\task\cron_task, mod_forum\task\cron_task, mod_lti\task\clean_access_tokens, mod_quiz\task\quiz_notify_attempt_manual_grading_completed, mod_quiz\task\update_overdue_attempts, mod_scorm\task\cron_task, mod_workshop\task\cron_task, quiz_statistics\task\recalculate, repository_dropbox\task\cron_task, repository_filesystem\task\cron_task, repository_onedrive\remove_temp_access_task, tool_analytics\task\predict_models, tool_analytics\task\train_models, tool_brickfield\task\bulk_process_caches, tool_brickfield\task\bulk_process_courses, tool_brickfield\task\checkid_validation, tool_brickfield\task\process_analysis_requests, tool_brickfield\task\update_summarydata, tool_cohortroles\task\cohort_role_sync, tool_dataprivacy\task\delete_existing_deleted_users, tool_dataprivacy\task\delete_expired_contexts, tool_dataprivacy\task\delete_expired_requests, tool_dataprivacy\task\expired_retention_period, tool_langimport\task\update_langpacks_task, tool_messageinbound\task\cleanup_task, tool_messageinbound\task\pickup_task, tool_monitor\task\check_subscriptions, tool_monitor\task\clean_events, tool_recyclebin\task\cleanup_category_bin, tool_recyclebin\task\cleanup_course_bin, tool_task\scheduled_checker_task, and workshopallocation_scheduled\task\cron_task.

◆ get_next_run_time()

core\task\task_base::get_next_run_time ( )

Get the next run time for this task.

Return values
inttimestamp

◆ get_pid()

core\task\task_base::get_pid ( )

Getter for $pid.

Return values
int

◆ get_runtime()

core\task\task_base::get_runtime ( )

Returns task runtime.

Return values
int

◆ get_runtime_result()

core\task\task_base::get_runtime_result ( )

Returns if the task has been running for too long.

Return values
result

◆ get_timestarted()

core\task\task_base::get_timestarted ( )

Getter for $timestarted.

Return values
int

◆ is_component_enabled()

core\task\task_base::is_component_enabled ( )

Informs whether the task's component is enabled.

Return values
booltrue when enabled. false otherwise.

◆ set_component()

core\task\task_base::set_component ( $component)

Setter for $component.

Parameters
string$component

◆ set_cron_lock()

core\task\task_base::set_cron_lock ( \core\lock\lock $lock)

Set the current lock for the entire cron process.

Parameters
core\lock\lock$lock

◆ set_fail_delay()

core\task\task_base::set_fail_delay ( $faildelay)

Setter for $faildelay.

Parameters
int$faildelay

◆ set_hostname()

core\task\task_base::set_hostname ( $hostname = null)

Setter for $hostname.

Parameters
string$hostname

◆ set_lock()

core\task\task_base::set_lock ( \core\lock\lock $lock)

Set the current lock for this task.

Parameters
core\lock\lock$lock

◆ set_next_run_time()

core\task\task_base::set_next_run_time ( $nextruntime)

Set the next run time for this task.

Parameters
int$nextruntime

◆ set_pid()

core\task\task_base::set_pid ( $pid = null)

Setter for $pid.

Parameters
int$pid

◆ set_timestarted()

core\task\task_base::set_timestarted ( $timestarted = null)

Setter for $timestarted.

Parameters
int$timestarted

Member Data Documentation

◆ __pad0__

replacement core\task\task_base::__pad0__

Setter for $blocking.

Please note that task blocking is no longer supported. If you are using it in older versions of Moodle you are strongly advised to rewrite your code as has a detrimental impact upon performance.

Deprecated
since Moodle 4.4 See MDL-67667
Todo
Remove in MDL-81509

◆ __pad1__

replacement core\task\task_base::__pad1__

Getter for $blocking.

Return values
bool
Deprecated
since Moodle 4.4 See MDL-67667
Todo
Remove in MDL-81509

The documentation for this class was generated from the following file: