當前位置: 首頁>>代碼示例>>PHP>>正文


PHP restore_controller::is_executing方法代碼示例

本文整理匯總了PHP中restore_controller::is_executing方法的典型用法代碼示例。如果您正苦於以下問題:PHP restore_controller::is_executing方法的具體用法?PHP restore_controller::is_executing怎麽用?PHP restore_controller::is_executing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在restore_controller的用法示例。


在下文中一共展示了restore_controller::is_executing方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: magic_get_requestorigin

 /**
  * Returns the origin of current request.
  *
  * Note: constants are not required because we need to use these values in logging and reports.
  *
  * @return string 'web', 'ws', 'cli', 'restore', etc.
  */
 protected function magic_get_requestorigin()
 {
     if (class_exists('restore_controller', false) && restore_controller::is_executing()) {
         return 'restore';
     }
     if (WS_SERVER) {
         return 'ws';
     }
     if (CLI_SCRIPT) {
         return 'cli';
     }
     return 'web';
 }
開發者ID:fliphess,項目名稱:moodle,代碼行數:20,代碼來源:pagelib.php

示例2: notify_changed

 /**
  * Used to notify the completion system (if necessary) that a user's grade
  * has changed, and clear up a possible score cache.
  *
  * @param bool $deleted True if grade was actually deleted
  */
 function notify_changed($deleted)
 {
     global $USER, $SESSION, $CFG, $COURSE, $DB;
     // Grades may be cached in user session
     if ($USER->id == $this->userid) {
         unset($SESSION->gradescorecache[$this->itemid]);
     }
     require_once $CFG->libdir . '/completionlib.php';
     // Bail out immediately if completion is not enabled for site (saves loading
     // grade item & requiring the restore stuff).
     if (!completion_info::is_enabled_for_site()) {
         return;
     }
     // Ignore during restore, as completion data will be updated anyway and
     // doing it now will result in incorrect dates (it will say they got the
     // grade completion now, instead of the correct time).
     if (class_exists('restore_controller', false) && restore_controller::is_executing()) {
         return;
     }
     // Load information about grade item
     $this->load_grade_item();
     // Only course-modules have completion data
     if ($this->grade_item->itemtype != 'mod') {
         return;
     }
     // Use $COURSE if available otherwise get it via item fields
     if (!empty($COURSE) && $COURSE->id == $this->grade_item->courseid) {
         $course = $COURSE;
     } else {
         $course = $DB->get_record('course', array('id' => $this->grade_item->courseid));
     }
     // Bail out if completion is not enabled for course
     $completion = new completion_info($course);
     if (!$completion->is_enabled()) {
         return;
     }
     // Get course-module
     $cm = get_coursemodule_from_instance($this->grade_item->itemmodule, $this->grade_item->iteminstance, $this->grade_item->courseid);
     // If the course-module doesn't exist, display a warning...
     if (!$cm) {
         // ...unless the grade is being deleted in which case it's likely
         // that the course-module was just deleted too, so that's okay.
         if (!$deleted) {
             debugging("Couldn't find course-module for module '" . $this->grade_item->itemmodule . "', instance '" . $this->grade_item->iteminstance . "', course '" . $this->grade_item->courseid . "'");
         }
         return;
     }
     // Pass information on to completion system
     $completion->inform_grade_changed($cm, $this->grade_item, $this, $deleted);
 }
開發者ID:masaterutakeno,項目名稱:MoodleMobile,代碼行數:56,代碼來源:grade_grade.php

示例3: notify_changed

 /**
  * Used to notify the completion system (if necessary) that a user's grade
  * has changed, and clear up a possible score cache.
  *
  * @param bool $deleted True if grade was actually deleted
  */
 protected function notify_changed($deleted)
 {
     global $CFG;
     // Condition code may cache the grades for conditional availability of
     // modules or sections. (This code should use a hook for communication
     // with plugin, but hooks are not implemented at time of writing.)
     if (!empty($CFG->enableavailability) && class_exists('\\availability_grade\\callbacks')) {
         \availability_grade\callbacks::grade_changed($this->userid);
     }
     require_once $CFG->libdir . '/completionlib.php';
     // Bail out immediately if completion is not enabled for site (saves loading
     // grade item & requiring the restore stuff).
     if (!completion_info::is_enabled_for_site()) {
         return;
     }
     // Ignore during restore, as completion data will be updated anyway and
     // doing it now will result in incorrect dates (it will say they got the
     // grade completion now, instead of the correct time).
     if (class_exists('restore_controller', false) && restore_controller::is_executing()) {
         return;
     }
     // Load information about grade item
     $this->load_grade_item();
     // Only course-modules have completion data
     if ($this->grade_item->itemtype != 'mod') {
         return;
     }
     // Use $COURSE if available otherwise get it via item fields
     $course = get_course($this->grade_item->courseid, false);
     // Bail out if completion is not enabled for course
     $completion = new completion_info($course);
     if (!$completion->is_enabled()) {
         return;
     }
     // Get course-module
     $cm = get_coursemodule_from_instance($this->grade_item->itemmodule, $this->grade_item->iteminstance, $this->grade_item->courseid);
     // If the course-module doesn't exist, display a warning...
     if (!$cm) {
         // ...unless the grade is being deleted in which case it's likely
         // that the course-module was just deleted too, so that's okay.
         if (!$deleted) {
             debugging("Couldn't find course-module for module '" . $this->grade_item->itemmodule . "', instance '" . $this->grade_item->iteminstance . "', course '" . $this->grade_item->courseid . "'");
         }
         return;
     }
     // Pass information on to completion system
     $completion->inform_grade_changed($cm, $this->grade_item, $this, $deleted);
 }
開發者ID:sriysk,項目名稱:moodle-integration,代碼行數:54,代碼來源:grade_grade.php

示例4: update_progress

 public function update_progress()
 {
     $this->executing[] = restore_controller::is_executing();
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:4,代碼來源:controller_test.php


注:本文中的restore_controller::is_executing方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。