当前位置: 首页>>代码示例>>PHP>>正文


PHP XenForo_DataWriter::getErrors方法代码示例

本文整理汇总了PHP中XenForo_DataWriter::getErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_DataWriter::getErrors方法的具体用法?PHP XenForo_DataWriter::getErrors怎么用?PHP XenForo_DataWriter::getErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XenForo_DataWriter的用法示例。


在下文中一共展示了XenForo_DataWriter::getErrors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: assertNoErrors

 public static function assertNoErrors(XenForo_DataWriter $dw, $checkMethod, $dataType)
 {
     switch (strtolower($checkMethod)) {
         case 'delete':
         case 'predelete':
             $checkMethod = 'preDelete';
             break;
         case 'save':
         case 'presave':
         default:
             $checkMethod = 'preSave';
             break;
     }
     $dw->{$checkMethod}();
     if ($errors = $dw->getErrors()) {
         $errorString = implode("\n\t", $errors);
         XenForo_Helper_File::log('webdav-error', sprintf("%s:\n\t%s\n\t%s", $dataType, $dw->get('title'), $errorString), false);
         // Note that in order to have Dreamweaver actually show an error, we have to use 'Forbidden'.
         throw new Sabre_DAV_Exception_Forbidden($errorString);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:21,代码来源:ErrorHandler.php

示例2: assertNoDwErrors

 public function assertNoDwErrors(XenForo_DataWriter $dw, $checkMethod, $dataType)
 {
     switch (strtolower($checkMethod)) {
         case 'delete':
         case 'predelete':
             $checkMethod = 'preDelete';
             break;
         case 'save':
         case 'presave':
         default:
             $checkMethod = 'preSave';
             break;
     }
     $dw->{$checkMethod}();
     if ($errors = $dw->getErrors()) {
         $filePath = $this->getDirectory($dw->getMergedData()) . self::$s . $this->getFileName($dw->getMergedData());
         if (count($errors) == 1) {
             $error = htmlspecialchars_decode($errors[key($errors)]);
             // Yes Nathan, I could use regex but fuu
             if (strpos($error, 'Line ') === 0) {
                 $pos = strpos($error, ':');
                 $line = substr($error, 5, $pos - 5);
                 $error = trim(substr($error, $pos + 1));
             }
             $errorString = 'E: ' . $dataType . ' Error: ' . $error . " in " . $filePath;
             if (isset($line)) {
                 $errorString .= ", line {$line} \n\n";
             } else {
                 $errorString .= "\n\n";
             }
         } else {
             foreach ($errors as &$err) {
                 $err = htmlspecialchars_decode($err);
             }
             $errorString = 'E: ' . $dataType . " Error: \nin " . $filePath . "\n";
             $errorString .= implode("\n", $errors) . "\n\n";
         }
         XenForo_Helper_File::log('devtools-error', str_replace("\n", ' ', $errorString));
         $this->printDebugInfo($errorString);
         die;
         // throwing wasn't working with console so just doing this
         throw new XenForo_Exception($errorString);
     }
 }
开发者ID:robclancy,项目名称:XenForo-Developer-Tools,代码行数:44,代码来源:Abstract.php


注:本文中的XenForo_DataWriter::getErrors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。