X7ROOT File Manager
Current Path:
/home/cbholdings/pasukulu/lib/classes/event
home
/
cbholdings
/
pasukulu
/
lib
/
classes
/
event
/
📁
..
📄
antivirus_scan_data_error.php
(1.97 KB)
📄
antivirus_scan_file_error.php
(1.97 KB)
📄
assessable_submitted.php
(2.05 KB)
📄
assessable_uploaded.php
(2.81 KB)
📄
badge_archived.php
(2.51 KB)
📄
badge_awarded.php
(2.97 KB)
📄
badge_created.php
(2.51 KB)
📄
badge_criteria_created.php
(3.16 KB)
📄
badge_criteria_deleted.php
(3.16 KB)
📄
badge_criteria_updated.php
(3.16 KB)
📄
badge_deleted.php
(3.46 KB)
📄
badge_disabled.php
(2.52 KB)
📄
badge_duplicated.php
(2.52 KB)
📄
badge_enabled.php
(2.52 KB)
📄
badge_listing_viewed.php
(3.62 KB)
📄
badge_revoked.php
(3.12 KB)
📄
badge_updated.php
(2.51 KB)
📄
badge_viewed.php
(2.91 KB)
📄
base.php
(34.42 KB)
📄
blog_association_created.php
(4.22 KB)
📄
blog_association_deleted.php
(3.49 KB)
📄
blog_comment_created.php
(1.86 KB)
📄
blog_comment_deleted.php
(1.86 KB)
📄
blog_entries_viewed.php
(3.51 KB)
📄
blog_entry_created.php
(3.37 KB)
📄
blog_entry_deleted.php
(3.13 KB)
📄
blog_entry_updated.php
(3.34 KB)
📄
blog_external_added.php
(2.93 KB)
📄
blog_external_removed.php
(2.21 KB)
📄
blog_external_updated.php
(2.93 KB)
📄
blog_external_viewed.php
(2.21 KB)
📄
calendar_event_created.php
(3.36 KB)
📄
calendar_event_deleted.php
(3.09 KB)
📄
calendar_event_updated.php
(3.31 KB)
📄
calendar_subscription_created.php
(4.25 KB)
📄
calendar_subscription_deleted.php
(4.54 KB)
📄
calendar_subscription_updated.php
(4.26 KB)
📄
capability_assigned.php
(3.17 KB)
📄
capability_unassigned.php
(2.4 KB)
📄
cohort_created.php
(2.22 KB)
📄
cohort_deleted.php
(2.22 KB)
📄
cohort_member_added.php
(2.61 KB)
📄
cohort_member_removed.php
(2.63 KB)
📄
cohort_updated.php
(2.21 KB)
📄
comment_created.php
(3.11 KB)
📄
comment_deleted.php
(3.11 KB)
📄
comments_viewed.php
(2.19 KB)
📄
competency_comment_created.php
(1.69 KB)
📄
competency_comment_deleted.php
(1.54 KB)
📄
competency_created.php
(2.96 KB)
📄
competency_deleted.php
(3.3 KB)
📄
competency_evidence_created.php
(5.5 KB)
📄
competency_framework_created.php
(3.15 KB)
📄
competency_framework_deleted.php
(2.92 KB)
📄
competency_framework_updated.php
(3.15 KB)
📄
competency_framework_viewed.php
(3.04 KB)
📄
competency_plan_approved.php
(3.01 KB)
📄
competency_plan_completed.php
(3.02 KB)
📄
competency_plan_created.php
(2.93 KB)
📄
competency_plan_deleted.php
(2.75 KB)
📄
competency_plan_reopened.php
(3.01 KB)
📄
competency_plan_review_request_cancelled.php
(3.11 KB)
📄
competency_plan_review_requested.php
(3.06 KB)
📄
competency_plan_review_started.php
(3.05 KB)
📄
competency_plan_review_stopped.php
(3.05 KB)
📄
competency_plan_unapproved.php
(3.02 KB)
📄
competency_plan_unlinked.php
(2.93 KB)
📄
competency_plan_updated.php
(3.04 KB)
📄
competency_plan_viewed.php
(2.92 KB)
📄
competency_template_created.php
(3.03 KB)
📄
competency_template_deleted.php
(2.79 KB)
📄
competency_template_updated.php
(3.13 KB)
📄
competency_template_viewed.php
(3.02 KB)
📄
competency_updated.php
(2.96 KB)
📄
competency_user_competency_plan_viewed.php
(4.23 KB)
📄
competency_user_competency_rated.php
(3.88 KB)
📄
competency_user_competency_rated_in_course.php
(4.69 KB)
📄
competency_user_competency_rated_in_plan.php
(4.56 KB)
📄
competency_user_competency_review_request_cancelled.php
(3.5 KB)
📄
competency_user_competency_review_requested.php
(3.48 KB)
📄
competency_user_competency_review_started.php
(3.46 KB)
📄
competency_user_competency_review_stopped.php
(3.46 KB)
📄
competency_user_competency_viewed.php
(3.72 KB)
📄
competency_user_competency_viewed_in_course.php
(4.27 KB)
📄
competency_user_competency_viewed_in_plan.php
(4.31 KB)
📄
competency_user_evidence_created.php
(3.22 KB)
📄
competency_user_evidence_deleted.php
(3.04 KB)
📄
competency_user_evidence_updated.php
(3.22 KB)
📄
competency_viewed.php
(2.96 KB)
📄
completion_defaults_updated.php
(3 KB)
📄
config_log_created.php
(3.61 KB)
📄
content_viewed.php
(3.54 KB)
📄
contentbank_content_created.php
(3.77 KB)
📄
contentbank_content_deleted.php
(3.53 KB)
📄
contentbank_content_updated.php
(3.77 KB)
📄
contentbank_content_uploaded.php
(3.77 KB)
📄
contentbank_content_viewed.php
(3.76 KB)
📄
context_locked.php
(2.44 KB)
📄
context_unlocked.php
(2.45 KB)
📄
course_backup_created.php
(3.24 KB)
📄
course_category_created.php
(2.27 KB)
📄
course_category_deleted.php
(3.56 KB)
📄
course_category_updated.php
(2.34 KB)
📄
course_category_viewed.php
(2.31 KB)
📄
course_completed.php
(4.11 KB)
📄
course_completion_updated.php
(2.09 KB)
📄
course_content_deleted.php
(2.52 KB)
📄
course_created.php
(2.73 KB)
📄
course_deleted.php
(2.59 KB)
📄
course_information_viewed.php
(2.45 KB)
📄
course_module_completion_updated.php
(3.75 KB)
📄
course_module_created.php
(4.38 KB)
📄
course_module_deleted.php
(2.97 KB)
📄
course_module_instance_list_viewed.php
(3.17 KB)
📄
course_module_instances_list_viewed.php
(1.72 KB)
📄
course_module_updated.php
(4.36 KB)
📄
course_module_viewed.php
(2.85 KB)
📄
course_reset_ended.php
(2.52 KB)
📄
course_reset_started.php
(2.54 KB)
📄
course_resources_list_viewed.php
(2.41 KB)
📄
course_restored.php
(3.93 KB)
📄
course_section_created.php
(3.47 KB)
📄
course_section_deleted.php
(2.63 KB)
📄
course_section_updated.php
(2.83 KB)
📄
course_updated.php
(2.6 KB)
📄
course_user_report_viewed.php
(3.15 KB)
📄
course_viewed.php
(3.57 KB)
📄
courses_searched.php
(2.7 KB)
📄
dashboard_reset.php
(1.97 KB)
📄
dashboard_viewed.php
(1.77 KB)
📄
dashboards_reset.php
(2.17 KB)
📄
database_text_field_content_replaced.php
(2.51 KB)
📄
draft_file_added.php
(2.76 KB)
📄
email_failed.php
(2.87 KB)
📄
enrol_instance_created.php
(3.23 KB)
📄
enrol_instance_deleted.php
(3.28 KB)
📄
enrol_instance_updated.php
(3.28 KB)
📄
grade_deleted.php
(4.15 KB)
📄
grade_exported.php
(2.59 KB)
📄
grade_item_created.php
(4.12 KB)
📄
grade_item_deleted.php
(1.98 KB)
📄
grade_item_updated.php
(2.05 KB)
📄
grade_letter_created.php
(2.53 KB)
📄
grade_letter_deleted.php
(2.24 KB)
📄
grade_letter_updated.php
(2.54 KB)
📄
grade_report_viewed.php
(2.44 KB)
📄
group_created.php
(2.09 KB)
📄
group_deleted.php
(2.09 KB)
📄
group_member_added.php
(3.12 KB)
📄
group_member_removed.php
(2.49 KB)
📄
group_message_sent.php
(4.83 KB)
📄
group_updated.php
(2.09 KB)
📄
grouping_created.php
(2.12 KB)
📄
grouping_deleted.php
(2.2 KB)
📄
grouping_group_assigned.php
(2.88 KB)
📄
grouping_group_unassigned.php
(2.89 KB)
📄
grouping_updated.php
(2.11 KB)
📄
insights_viewed.php
(2.37 KB)
📄
manager.php
(12.45 KB)
📄
message_contact_added.php
(2.58 KB)
📄
message_contact_removed.php
(2.59 KB)
📄
message_deleted.php
(4.66 KB)
📄
message_sent.php
(4.12 KB)
📄
message_user_blocked.php
(2.33 KB)
📄
message_user_unblocked.php
(2.34 KB)
📄
message_viewed.php
(3.04 KB)
📄
mnet_access_control_created.php
(3.33 KB)
📄
mnet_access_control_updated.php
(3.4 KB)
📄
moodlenet_resource_exported.php
(2.24 KB)
📄
mycourses_viewed.php
(1.6 KB)
📄
note_created.php
(2.97 KB)
📄
note_deleted.php
(2.67 KB)
📄
note_updated.php
(2.97 KB)
📄
notes_viewed.php
(2.23 KB)
📄
notification_sent.php
(4.37 KB)
📄
notification_viewed.php
(3.75 KB)
📄
prediction_action_started.php
(3.26 KB)
📄
question_base.php
(3.75 KB)
📄
question_category_base.php
(2.83 KB)
📄
question_category_created.php
(1.78 KB)
📄
question_category_deleted.php
(1.75 KB)
📄
question_category_moved.php
(1.74 KB)
📄
question_category_updated.php
(1.75 KB)
📄
question_category_viewed.php
(1.74 KB)
📄
question_created.php
(2.65 KB)
📄
question_deleted.php
(2.17 KB)
📄
question_moved.php
(4 KB)
📄
question_updated.php
(1.86 KB)
📄
question_viewed.php
(1.86 KB)
📄
questions_exported.php
(3.31 KB)
📄
questions_imported.php
(3.31 KB)
📄
recent_activity_viewed.php
(2.27 KB)
📄
role_allow_assign_updated.php
(2.29 KB)
📄
role_allow_override_updated.php
(2.3 KB)
📄
role_allow_switch_updated.php
(2.29 KB)
📄
role_allow_view_updated.php
(2.29 KB)
📄
role_assigned.php
(3.29 KB)
📄
role_capabilities_updated.php
(2.83 KB)
📄
role_created.php
(2.2 KB)
📄
role_deleted.php
(2.76 KB)
📄
role_unassigned.php
(3.27 KB)
📄
role_updated.php
(2.35 KB)
📄
scale_created.php
(2.48 KB)
📄
scale_deleted.php
(2.19 KB)
📄
scale_updated.php
(2.48 KB)
📄
search_indexed.php
(2.07 KB)
📄
search_results_viewed.php
(3.14 KB)
📄
tag_added.php
(4.57 KB)
📄
tag_collection_created.php
(2.2 KB)
📄
tag_collection_deleted.php
(2.2 KB)
📄
tag_collection_updated.php
(2.2 KB)
📄
tag_created.php
(3.18 KB)
📄
tag_deleted.php
(2.65 KB)
📄
tag_flagged.php
(2.65 KB)
📄
tag_removed.php
(4.58 KB)
📄
tag_unflagged.php
(2.65 KB)
📄
tag_updated.php
(2.71 KB)
📄
unknown_logged.php
(1.44 KB)
📄
user_created.php
(3.92 KB)
📄
user_deleted.php
(3.52 KB)
📄
user_enrolment_created.php
(3.04 KB)
📄
user_enrolment_deleted.php
(3.25 KB)
📄
user_enrolment_updated.php
(3.06 KB)
📄
user_graded.php
(4.66 KB)
📄
user_info_category_created.php
(3.47 KB)
📄
user_info_category_deleted.php
(3.2 KB)
📄
user_info_category_updated.php
(3.46 KB)
📄
user_info_field_created.php
(3.97 KB)
📄
user_info_field_deleted.php
(3.67 KB)
📄
user_info_field_updated.php
(3.97 KB)
📄
user_list_viewed.php
(2.47 KB)
📄
user_loggedin.php
(2.87 KB)
📄
user_loggedinas.php
(3.1 KB)
📄
user_loggedout.php
(2.36 KB)
📄
user_login_failed.php
(3.73 KB)
📄
user_password_policy_failed.php
(2.57 KB)
📄
user_password_updated.php
(3.56 KB)
📄
user_profile_viewed.php
(3.28 KB)
📄
user_updated.php
(3.02 KB)
📄
userfeedback_give.php
(1.71 KB)
📄
userfeedback_remind.php
(1.72 KB)
📄
virus_infected_data_detected.php
(2.17 KB)
📄
virus_infected_file_detected.php
(2.17 KB)
📄
webservice_function_called.php
(2.42 KB)
📄
webservice_login_failed.php
(3.09 KB)
📄
webservice_service_created.php
(2.5 KB)
📄
webservice_service_deleted.php
(2.3 KB)
📄
webservice_service_updated.php
(2.3 KB)
📄
webservice_service_user_added.php
(2.68 KB)
📄
webservice_service_user_removed.php
(2.69 KB)
📄
webservice_token_created.php
(2.96 KB)
📄
webservice_token_sent.php
(2.07 KB)
Editing: manager.php
<?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. namespace core\event; defined('MOODLE_INTERNAL') || die(); /** * New event manager class. * * @package core * @since Moodle 2.6 * @copyright 2013 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * Class used for event dispatching. * * Note: Do NOT use directly in your code, it is intended to be used from * base event class only. */ class manager { /** @var array buffer of event for dispatching */ protected static $buffer = array(); /** @var array buffer for events that were not sent to external observers when DB transaction in progress */ protected static $extbuffer = array(); /** @var bool evert dispatching already in progress - prevents nesting */ protected static $dispatching = false; /** @var array cache of all observers */ protected static $allobservers = null; /** @var bool should we reload observers after the test? */ protected static $reloadaftertest = false; /** * Trigger new event. * * @internal to be used only from \core\event\base::trigger() method. * @param \core\event\base $event * * @throws \coding_Exception if used directly. */ public static function dispatch(\core\event\base $event) { if (during_initial_install()) { return; } if (!$event->is_triggered() or $event->is_dispatched()) { throw new \coding_exception('Illegal event dispatching attempted.'); } self::$buffer[] = $event; if (self::$dispatching) { return; } self::$dispatching = true; self::process_buffers(); self::$dispatching = false; } /** * Notification from DML layer. * @internal to be used from DML layer only. */ public static function database_transaction_commited() { if (self::$dispatching or empty(self::$extbuffer)) { return; } self::$dispatching = true; self::process_buffers(); self::$dispatching = false; } /** * Notification from DML layer. * @internal to be used from DML layer only. */ public static function database_transaction_rolledback() { self::$extbuffer = array(); } protected static function process_buffers() { global $DB, $CFG; self::init_all_observers(); while (self::$buffer or self::$extbuffer) { $fromextbuffer = false; $addedtoextbuffer = false; if (self::$extbuffer and !$DB->is_transaction_started()) { $fromextbuffer = true; $event = reset(self::$extbuffer); unset(self::$extbuffer[key(self::$extbuffer)]); } else if (self::$buffer) { $event = reset(self::$buffer); unset(self::$buffer[key(self::$buffer)]); } else { return; } $observingclasses = self::get_observing_classes($event); foreach ($observingclasses as $observingclass) { if (!isset(self::$allobservers[$observingclass])) { continue; } foreach (self::$allobservers[$observingclass] as $observer) { if ($observer->internal) { if ($fromextbuffer) { // Do not send buffered external events to internal handlers, // they processed them already. continue; } } else { if ($DB->is_transaction_started()) { if ($fromextbuffer) { // Weird! continue; } // Do not notify external observers while in DB transaction. if (!$addedtoextbuffer) { self::$extbuffer[] = $event; $addedtoextbuffer = true; } continue; } } if (isset($observer->includefile) and file_exists($observer->includefile)) { include_once($observer->includefile); } if (is_callable($observer->callable)) { try { call_user_func($observer->callable, $event); } catch (\Exception $e) { // Observers are notified before installation and upgrade, this may throw errors. if (empty($CFG->upgraderunning)) { // Ignore errors during upgrade, otherwise warn developers. debugging("Exception encountered in event observer '$observer->callable': ".$e->getMessage(), DEBUG_DEVELOPER, $e->getTrace()); } } } else { debugging("Can not execute event observer '$observer->callable'"); } } } // TODO: Invent some infinite loop protection in case events cross-trigger one another. } } /** * Returns list of classes related to this event. * @param \core\event\base $event * @return array */ protected static function get_observing_classes(\core\event\base $event) { $classname = get_class($event); $observers = array('\\'.$classname); while ($classname = get_parent_class($classname)) { $observers[] = '\\'.$classname; } $observers = array_reverse($observers, false); return $observers; } /** * Initialise the list of observers. */ protected static function init_all_observers() { global $CFG; if (is_array(self::$allobservers)) { return; } if (!PHPUNIT_TEST and !during_initial_install()) { $cache = \cache::make('core', 'observers'); $cached = $cache->get('all'); $dirroot = $cache->get('dirroot'); if ($dirroot === $CFG->dirroot and is_array($cached)) { self::$allobservers = $cached; return; } } self::$allobservers = array(); $plugintypes = \core_component::get_plugin_types(); $plugintypes = array_merge(array('core' => 'not used'), $plugintypes); $systemdone = false; foreach ($plugintypes as $plugintype => $ignored) { if ($plugintype === 'core') { $plugins['core'] = "$CFG->dirroot/lib"; } else { $plugins = \core_component::get_plugin_list($plugintype); } foreach ($plugins as $plugin => $fulldir) { if (!file_exists("$fulldir/db/events.php")) { continue; } $observers = null; include("$fulldir/db/events.php"); if (!is_array($observers)) { continue; } self::add_observers($observers, "$fulldir/db/events.php", $plugintype, $plugin); } } self::order_all_observers(); if (!PHPUNIT_TEST and !during_initial_install()) { $cache->set('all', self::$allobservers); $cache->set('dirroot', $CFG->dirroot); } } /** * Add observers. * @param array $observers * @param string $file * @param string $plugintype Plugin type of the observer. * @param string $plugin Plugin of the observer. */ protected static function add_observers(array $observers, $file, $plugintype = null, $plugin = null) { global $CFG; foreach ($observers as $observer) { if (empty($observer['eventname']) or !is_string($observer['eventname'])) { debugging("Invalid 'eventname' detected in $file observer definition", DEBUG_DEVELOPER); continue; } if ($observer['eventname'] === '*') { $observer['eventname'] = '\core\event\base'; } if (strpos($observer['eventname'], '\\') !== 0) { $observer['eventname'] = '\\'.$observer['eventname']; } if (empty($observer['callback'])) { debugging("Invalid 'callback' detected in $file observer definition", DEBUG_DEVELOPER); continue; } $o = new \stdClass(); $o->callable = $observer['callback']; if (!isset($observer['priority'])) { $o->priority = 0; } else { $o->priority = (int)$observer['priority']; } if (!isset($observer['internal'])) { $o->internal = true; } else { $o->internal = (bool)$observer['internal']; } if (empty($observer['includefile'])) { $o->includefile = null; } else { if ($CFG->admin !== 'admin' and strpos($observer['includefile'], '/admin/') === 0) { $observer['includefile'] = preg_replace('|^/admin/|', '/'.$CFG->admin.'/', $observer['includefile']); } $observer['includefile'] = $CFG->dirroot . '/' . ltrim($observer['includefile'], '/'); if (!file_exists($observer['includefile'])) { debugging("Invalid 'includefile' detected in $file observer definition", DEBUG_DEVELOPER); continue; } $o->includefile = $observer['includefile']; } $o->plugintype = $plugintype; $o->plugin = $plugin; self::$allobservers[$observer['eventname']][] = $o; } } /** * Reorder observers to allow quick lookup of observer for each event. */ protected static function order_all_observers() { foreach (self::$allobservers as $classname => $observers) { \core_collator::asort_objects_by_property($observers, 'priority', \core_collator::SORT_NUMERIC); self::$allobservers[$classname] = array_reverse($observers); } } /** * Returns all observers in the system. This is only for use for reporting on the list of observers in the system. * * @access private * @return array An array of stdClass with all core observer details. */ public static function get_all_observers() { self::init_all_observers(); return self::$allobservers; } /** * Replace all standard observers. * @param array $observers * @return array * * @throws \coding_Exception if used outside of unit tests. */ public static function phpunit_replace_observers(array $observers) { if (!PHPUNIT_TEST) { throw new \coding_exception('Cannot override event observers outside of phpunit tests!'); } self::phpunit_reset(); self::$allobservers = array(); self::$reloadaftertest = true; self::add_observers($observers, 'phpunit'); self::order_all_observers(); return self::$allobservers; } /** * Reset everything if necessary. * @private * * @throws \coding_Exception if used outside of unit tests. */ public static function phpunit_reset() { if (!PHPUNIT_TEST) { throw new \coding_exception('Cannot reset event manager outside of phpunit tests!'); } self::$buffer = array(); self::$extbuffer = array(); self::$dispatching = false; if (!self::$reloadaftertest) { self::$allobservers = null; } self::$reloadaftertest = false; } }
Upload File
Create Folder