本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例8:
/**
* Constructor
*
* @param string $debuginfo the debug info
*/
function __construct($debuginfo)
{
parent::__construct('accessexception', 'webservice', '', null, $debuginfo);
}
示例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));
}
示例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);
}
示例11: __construct
public function __construct($errorcode, $a = NULL, $debuginfo = null)
{
parent::__construct($errorcode, 'error', '', $a, $debuginfo);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}