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


PHP moodle_exception類代碼示例

本文整理匯總了PHP中moodle_exception的典型用法代碼示例。如果您正苦於以下問題:PHP moodle_exception類的具體用法?PHP moodle_exception怎麽用?PHP moodle_exception使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: SAMoodleLibException

 /**
  *
  * @param mix $errorcode
  * @param object $a
  * @param string $debuginfo
  */
 public function SAMoodleLibException($errorcode, $a = NULL, $debuginfo = NULL)
 {
     if (is_a($errorcode, 'moodle_exception')) {
         //hack eclipse
         if (false) {
             $errorcode = new moodle_exception('');
         } else {
             $e = $errorcode;
             $errorcode = $e->errorcode;
             $a = $e->a;
             $debuginfo = $e->debuginfo;
         }
     } else {
         if (is_a($errorcode, 'Exception')) {
             //hack eclipse
             if (false) {
                 $errorcode = new moodle_exception('');
             } else {
                 $e = $errorcode;
                 $errorcode = $e->getMessage() . ', Código do Erro: ' . $e->getCode();
                 $debuginfo = $e->getCode();
             }
         }
     }
     /*$originalerrordocroot = $CFG->errordocroot;
     		 $CFG->errordocroot = '';
     		$CFG->errordocroot = $originaldocroot;
     		*/
     parent::__construct($errorcode, 'local_samoodlelib', '', $a, $debuginfo);
 }
開發者ID:LMSeXT,項目名稱:local_samoodlelib,代碼行數:36,代碼來源:exceptions.php

示例2: __construct

 public function __construct($quizobj, $errorcode, $a = null, $link = '', $debuginfo = null)
 {
     if (!$link) {
         $link = $quizobj->view_url();
     }
     parent::__construct($errorcode, 'quiz', $link, $a, $debuginfo);
 }
開發者ID:elie89,項目名稱:moodle,代碼行數:7,代碼來源:attemptlib.php

示例3: __construct

 /**
  * Constructor
  * @param int $instanceid the block instance id of the block that was looked for.
  * @param object $page the current page.
  */
 public function __construct($instanceid, $page)
 {
     $a = new stdClass();
     $a->instanceid = $instanceid;
     $a->url = $page->url->out();
     parent::__construct('blockdoesnotexistonpage', '', $page->url->out(), $a);
 }
開發者ID:Burick,項目名稱:moodle,代碼行數:12,代碼來源:blocklib.php

示例4:

 function __construct($errorcode, $a = null, $link = '', $debuginfo = null)
 {
     global $CFG;
     if (empty($link)) {
         $link = "{$CFG->wwwroot}/{$CFG->admin}/";
     }
     parent::__construct($errorcode, 'dbtransfer', $link, $a, $debuginfo);
 }
開發者ID:nicolasconnault,項目名稱:moodle2.0,代碼行數:8,代碼來源:dtllib.php

示例5: __construct

 public function __construct(array $errors = array())
 {
     $debuginfo = array();
     foreach ($errors as $key => $message) {
         $debuginfo[] = "{$key}: {$message}";
     }
     parent::__construct('invalidpersistent', 'core_competency', null, null, implode(' - ', $debuginfo));
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:8,代碼來源:invalid_persistent_exception.php

示例6: stdClass

 function __construct($errorstring, $line, $char, $link = '')
 {
     $this->errorstring = $errorstring;
     $this->line = $line;
     $this->char = $char;
     $a = new stdClass();
     $a->errorstring = $errorstring;
     $a->errorline = $line;
     $a->errorchar = $char;
     parent::__construct('errorparsingxml', 'error', $link, $a);
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:11,代碼來源:xmlize.php

示例7: stdClass

 function __construct($component, $expected, $current)
 {
     global $CFG;
     $a = new stdClass();
     $a->component = $component;
     $a->expected = $expected;
     $a->current = $current;
     parent::__construct('detectedmisplacedplugin', 'core_plugin', "{$CFG->wwwroot}/{$CFG->admin}/index.php", $a);
 }
開發者ID:tyleung,項目名稱:CMPUT401MoodleExams,代碼行數:9,代碼來源:upgradelib.php

示例8:

 /**
  * Constructor
  *
  * @param string $debuginfo the debug info
  */
 function __construct($debuginfo)
 {
     parent::__construct('accessexception', 'webservice', '', null, $debuginfo);
 }
開發者ID:rushi963,項目名稱:moodle,代碼行數:9,代碼來源:lib.php

示例9: __construct

 public function __construct($qubaid, $slot, $postdata)
 {
     if ($postdata == null) {
         $postdata = data_submitted();
     }
     parent::__construct('submissionoutofsequence', 'question', '', null, "QUBAid: {$qubaid}, slot: {$slot}, post data: " . print_r($postdata, true));
 }
開發者ID:mongo0se,項目名稱:moodle,代碼行數:7,代碼來源:lib.php

示例10:

 /**
  * Constructor
  * @param string $hint short description of problem
  * @param string $debuginfo optional more detailed information
  */
 function __construct($hint, $debuginfo = null)
 {
     parent::__construct('invalidstatedetected', 'debug', '', $hint, $debuginfo);
 }
開發者ID:nicolasconnault,項目名稱:moodle2.0,代碼行數:9,代碼來源:setuplib.php

示例11: __construct

 public function __construct($errorcode, $a = NULL, $debuginfo = null)
 {
     parent::__construct($errorcode, 'error', '', $a, $debuginfo);
 }
開發者ID:eamador,項目名稱:moodle-course-custom-fields,代碼行數:4,代碼來源:backup.class.php

示例12: __construct

 /**
  * @param string $errorcode exception description identifier
  * @param mixed $debuginfo debugging data to display
  */
 public function __construct($errorcode, $debuginfo = null)
 {
     parent::__construct($errorcode, 'core_plugin', '', null, print_r($debuginfo, true));
 }
開發者ID:masaterutakeno,項目名稱:MoodleMobile,代碼行數:8,代碼來源:pluginlib.php

示例13: __construct

 /**
  * Constructor.
  * @param string $component the component from version.php
  * @param string $expected expected directory, null means calculate
  * @param string $current plugin directory path
  */
 public function __construct($component, $expected, $current) {
     global $CFG;
     if (empty($expected)) {
         list($type, $plugin) = core_component::normalize_component($component);
         $plugintypes = core_component::get_plugin_types();
         if (isset($plugintypes[$type])) {
             $expected = $plugintypes[$type] . '/' . $plugin;
         }
     }
     if (strpos($expected, '$CFG->dirroot') !== 0) {
         $expected = str_replace($CFG->dirroot, '$CFG->dirroot', $expected);
     }
     if (strpos($current, '$CFG->dirroot') !== 0) {
         $current = str_replace($CFG->dirroot, '$CFG->dirroot', $current);
     }
     $a = new stdClass();
     $a->component = $component;
     $a->expected  = $expected;
     $a->current   = $current;
     parent::__construct('detectedmisplacedplugin', 'core_plugin', "$CFG->wwwroot/$CFG->admin/index.php", $a);
 }
開發者ID:jtibbetts,項目名稱:moodle,代碼行數:27,代碼來源:upgradelib.php

示例14:

 /**
  * Constructor
  *
  * @param string $errorcode error code
  * @param stdClass $a Extra words and phrases that might be required in the error string
  * @param string $debuginfo optional debugging information
  */
 function __construct($errorcode, $a = NULL, $debuginfo = NULL)
 {
     parent::__construct($errorcode, '', '', $a, $debuginfo);
 }
開發者ID:numbas,項目名稱:moodle,代碼行數:11,代碼來源:file_exceptions.php

示例15: __construct

 /**
  * Constructs a new exception
  *
  * @param string $errorcode
  * @param string $link
  * @param mixed $a
  * @param mixed $debuginfo
  */
 public function __construct($errorcode, $link = '', $a = null, $debuginfo = null)
 {
     parent::__construct($errorcode, 'antivirus', $link, $a, $debuginfo);
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:12,代碼來源:scanner_exception.php


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