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


PHP Gdn_Controller::GetStatusMessage方法代码示例

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


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

示例1: Error

 public function Error()
 {
     $this->RemoveCssFile('admin.css');
     $this->AddCssFile('style.css');
     $this->MasterView = 'default';
     $this->CssClass = 'SplashMessage NoPanel';
     $this->SetData('_NoMessages', TRUE);
     $Code = $this->Data('Code', 400);
     header("HTTP/1.0 {$Code} " . Gdn_Controller::GetStatusMessage($Code), TRUE, $Code);
     $this->Render();
 }
开发者ID:bishopb,项目名称:vanilla,代码行数:11,代码来源:class.homecontroller.php

示例2: error

 /**
  * Display error page.
  */
 public function error()
 {
     $this->removeCssFile('admin.css');
     $this->addCssFile('style.css');
     $this->addCssFile('vanillicon.css', 'static');
     $this->MasterView = 'default';
     $this->CssClass = 'SplashMessage NoPanel';
     $this->setData('_NoMessages', true);
     $Code = $this->data('Code', 400);
     safeheader("HTTP/1.0 {$Code} " . Gdn_Controller::GetStatusMessage($Code), true, $Code);
     Gdn_Theme::section('Error');
     $this->render();
 }
开发者ID:bryanjamesmiller,项目名称:p4,代码行数:16,代码来源:class.homecontroller.php

示例3: Gdn_ExceptionHandler

/**
 * A custom error handler that displays much more, very useful information when
 * errors are encountered in Garden.
 *	@param Exception $Exception The exception that was thrown.
 */
function Gdn_ExceptionHandler($Exception)
{
    try {
        $ErrorNumber = $Exception->getCode();
        $Message = $Exception->getMessage();
        $File = $Exception->getFile();
        $Line = $Exception->getLine();
        if (method_exists($Exception, 'getContext')) {
            $Arguments = $Exception->getContext();
        } else {
            $Arguments = '';
        }
        $Backtrace = $Exception->getTrace();
        // Clean the output buffer in case an error was encountered in-page.
        @ob_end_clean();
        // prevent headers already sent error
        if (!headers_sent()) {
            if ($ErrorNumber >= 100 && $ErrorNumber < 600) {
                $Code = $ErrorNumber;
            } else {
                $Code = 500;
            }
            if (class_exists('Gdn_Controller', false)) {
                $msg = Gdn_Controller::GetStatusMessage($Code);
            } else {
                $msg = 'Error';
            }
            safeHeader("HTTP/1.0 {$Code} {$msg}", TRUE, $ErrorNumber);
            safeHeader('Content-Type: text/html; charset=utf-8');
        }
        $SenderMessage = $Message;
        $SenderObject = 'PHP';
        $SenderMethod = 'Gdn_ErrorHandler';
        $SenderCode = FALSE;
        $SenderTrace = $Backtrace;
        $MessageInfo = explode('|', $Message);
        $MessageCount = count($MessageInfo);
        if ($MessageCount == 4) {
            list($SenderMessage, $SenderObject, $SenderMethod, $SenderCode) = $MessageInfo;
        } else {
            if ($MessageCount == 3) {
                list($SenderMessage, $SenderObject, $SenderMethod) = $MessageInfo;
            } elseif (function_exists('GetValueR')) {
                $IsError = GetValueR('0.function', $SenderTrace) == 'Gdn_ErrorHandler';
                // not exception
                $N = $IsError ? '1' : '0';
                $SenderMethod = GetValueR($N . '.function', $SenderTrace, $SenderMethod);
                $SenderObject = GetValueR($N . '.class', $SenderTrace, $SenderObject);
            }
        }
        $SenderMessage = htmlspecialchars($SenderMessage);
        $Master = FALSE;
        // The parsed master view
        $CssPath = FALSE;
        // The web-path to the css file
        $ErrorLines = FALSE;
        // The lines near the error's line #
        $DeliveryType = defined('DELIVERY_TYPE_ALL') ? DELIVERY_TYPE_ALL : 'ALL';
        if (array_key_exists('DeliveryType', $_POST)) {
            $DeliveryType = $_POST['DeliveryType'];
        } else {
            if (array_key_exists('DeliveryType', $_GET)) {
                $DeliveryType = $_GET['DeliveryType'];
            }
        }
        if (function_exists('Debug') && Debug()) {
            $Debug = TRUE;
        } else {
            $Debug = FALSE;
        }
        // Make sure all of the required custom functions and variables are defined.
        $PanicError = FALSE;
        // Should we just dump a message and forget about the master view?
        if (!defined('DS')) {
            $PanicError = TRUE;
        }
        if (!defined('PATH_ROOT')) {
            $PanicError = TRUE;
        }
        if (!defined('APPLICATION')) {
            define('APPLICATION', 'Garden');
        }
        if (!defined('APPLICATION_VERSION')) {
            define('APPLICATION_VERSION', 'Unknown');
        }
        $WebRoot = '';
        // Try and rollback a database transaction.
        if (class_exists('Gdn', FALSE)) {
            $Database = Gdn::Database();
            if (is_object($Database)) {
                $Database->RollbackTransaction();
            }
        }
        if ($PanicError === FALSE) {
            // See if we can get the file that caused the error
//.........这里部分代码省略.........
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:101,代码来源:functions.error.php

示例4: T

   <div class="Center">
      <h1><?php 
echo $this->Data('Title', T('Whoops!'));
?>
</h1>
      <div id="Message">
         <?php 
echo Gdn_Format::Markdown($this->Data('Exception', 'Add your message here foo.'));
?>
      </div>
   </div>
   <?php 
if (Debug() && $this->Data('Trace')) {
    ?>
   <h2>Error</h2>
   <?php 
    echo $this->Data('Code') . ' ' . htmlspecialchars(Gdn_Controller::GetStatusMessage($this->Data('Code')));
    ?>
   <h2>Trace</h2>
      <pre stye="text-align"><?php 
    echo htmlspecialchars($this->Data('Trace'));
    ?>
</pre>
   <?php 
}
?>
   <!-- Code: <?php 
$this->Data('Code', 400);
?>
 -->
</div>
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:31,代码来源:error.php


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