本文整理汇总了PHP中AError::toDebug方法的典型用法代码示例。如果您正苦于以下问题:PHP AError::toDebug方法的具体用法?PHP AError::toDebug怎么用?PHP AError::toDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AError
的用法示例。
在下文中一共展示了AError::toDebug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_error
/**
* Get language definition for error. Function returns text anyway!
*
* @param string $key
* @return string
*/
public function get_error($key)
{
$result = $this->get($key);
if ($key == $result || trim($result) == '') {
$backtrace = debug_backtrace();
$ts = time();
$log_message = $ts . "- Not described error.\n" . "File: " . $backtrace[0]['file'] . "\n" . "Line: " . $backtrace[0]['line'] . "\n" . "Args: " . var_export($backtrace[0]['args'], true) . "\n";
$e = new AError($log_message);
$e->toDebug()->toLog()->toMessages();
$result = "Not described error happened.";
if (IS_ADMIN === true) {
$result .= "Check log for details. Code [" . $ts . "]";
}
}
return $result;
}
示例2: processError
/**
* @param string $title
* @param string $error
* @param string $level
* @return string
*/
private function processError($title, $error, $level = 'warning')
{
$this->message->{'save' . ucfirst($level)}($title, $error);
$wrn = new AError($error);
$wrn->toDebug()->toLog();
return $error;
}
示例3: getField
/**
* Get given field, type, values and selected/default
*
* @param string $fname
* @return array with field data
*/
public function getField($fname)
{
foreach ($this->fields as $field) {
if ($field['field_name'] == $fname) {
return array('field_name' => $field['field_name'], 'element_type' => $field['element_type'], 'required' => $field['required'], 'name' => $field['name'], 'value' => $field['value'], 'settings' => $field['settings'], 'description' => $field['description']);
}
}
$err = new AError('NOT EXIST Form field with name ' . $fname);
$err->toDebug()->toLog();
return null;
}
示例4: fetch
/**
* Process the template
* @param $filename
* @return string
*/
public function fetch($filename)
{
ADebug::checkpoint('fetch ' . $filename . ' start');
//#PR First see if we have full path to template file. Nothing to do. Higher precedence!
if (is_file($filename)) {
//#PR set full path
$file = $filename;
} else {
//#PR Build the path to the template file
$path = DIR_TEMPLATE;
if (!defined('INSTALL')) {
$file = $this->_get_template_path($path, '/template/' . $filename, 'full');
} else {
$file = $path . $filename;
}
if ($this->has_extensions && ($result = $this->extensions->isExtensionResource('T', $filename))) {
if (is_file($file)) {
$warning = new AWarning("Extension <b>" . $result['extension'] . "</b> overrides core template with <b>" . $filename . "</b>");
$warning->toDebug();
}
$file = $result['file'];
}
}
if (is_file($file)) {
$content = '';
$file_pre = str_replace('.tpl', POSTFIX_PRE . '.tpl', $filename);
if ($result = $this->extensions->isExtensionResource('T', $file_pre)) {
$content .= $this->_fetch($result['file']);
}
$content .= $this->_fetch($file);
$file_post = str_replace('.tpl', POSTFIX_POST . '.tpl', $filename);
if ($result = $this->extensions->isExtensionResource('T', $file_post)) {
$content .= $this->_fetch($result['file']);
}
ADebug::checkpoint('fetch ' . $filename . ' end');
return $content;
} else {
$error = new AError('Error: Could not load template ' . $filename . '!', AC_ERR_LOAD);
$error->toDebug()->toLog();
}
return '';
}
示例5: fetch
/**
* Process the template
* @param $filename
* @return string
*/
public function fetch($filename)
{
ADebug::checkpoint('fetch ' . $filename . ' start');
//#PR First see if we have full path to template file. Nothing to do. Higher precedence!
if (is_file($filename)) {
//#PR set full path
$file = $filename;
} else {
//#PR Build the path to the template file
$path = DIR_TEMPLATE;
if (!defined('INSTALL')) {
$file = $this->_get_template_path($path, '/template/' . $filename, 'full');
} else {
$file = $path . $filename;
}
if ($this->has_extensions && ($result = $this->extensions->isExtensionResource('T', $filename))) {
if (is_file($file)) {
$warning = new AWarning("Extension <b>" . $result['extension'] . "</b> overrides core template with <b>" . $filename . "</b>");
$warning->toDebug();
}
$file = $result['file'];
}
}
if (empty($file)) {
$error = new AError('Error: Unable to identify file path to template ' . $filename . '! Check blocks in the layout or enable debug mode to get more details. ' . AC_ERR_LOAD);
$error->toDebug()->toLog();
return '';
}
if (is_file($file)) {
$content = '';
$file_pre = str_replace('.tpl', POSTFIX_PRE . '.tpl', $filename);
if ($result = $this->extensions->getAllPrePostTemplates($file_pre)) {
foreach ($result as $item) {
$content .= $this->_fetch($item['file']);
}
}
$content .= $this->_fetch($file);
$file_post = str_replace('.tpl', POSTFIX_POST . '.tpl', $filename);
if ($result = $this->extensions->getAllPrePostTemplates($file_post)) {
foreach ($result as $item) {
$content .= $this->_fetch($item['file']);
}
}
ADebug::checkpoint('fetch ' . $filename . ' end');
//Write HTML Cache if we need and can write
if ($this->config && $this->config->get('config_html_cache') && $this->html_cache_key) {
if ($this->cache->save_html_cache($this->html_cache_key, $content) === false) {
$error = new AError('Error: Cannot create HTML cache for file ' . $this->html_cache_key . '! Directory to write cache is not writable', AC_ERR_LOAD);
$error->toDebug()->toLog();
}
}
return $content;
} else {
$error = new AError('Error: Cannot load template ' . $filename . '! File ' . $file . ' is missing or incorrect. Check blocks in the layout or enable debug mode to get more details. ', AC_ERR_LOAD);
$error->toDebug()->toLog();
}
return '';
}