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


PHP Helpers::getSource方法代碼示例

本文整理匯總了PHP中Helpers::getSource方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helpers::getSource方法的具體用法?PHP Helpers::getSource怎麽用?PHP Helpers::getSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Helpers的用法示例。


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

示例1: render

 /**
  * Renders blue screen.
  * @param  \Exception|\Throwable
  * @return void
  */
 public function render($exception)
 {
     $panels = $this->panels;
     $info = array_filter($this->info);
     $source = Helpers::getSource();
     $sourceIsUrl = preg_match('#^https?://#', $source);
     $title = $exception instanceof \ErrorException ? Helpers::errorTypeToString($exception->getSeverity()) : get_class($exception);
     $skipError = $sourceIsUrl && $exception instanceof \ErrorException && !empty($exception->skippable) ? $source . (strpos($source, '?') ? '&' : '?') . '_tracy_skip_error' : NULL;
     require __DIR__ . '/assets/BlueScreen/bluescreen.phtml';
 }
開發者ID:VasekPurchart,項目名稱:tracy,代碼行數:15,代碼來源:BlueScreen.php

示例2: renderTemplate

 private function renderTemplate($exception, $template)
 {
     $info = array_filter($this->info);
     $source = Helpers::getSource();
     $sourceIsUrl = preg_match('#^https?://#', $source);
     $title = $exception instanceof \ErrorException ? Helpers::errorTypeToString($exception->getSeverity()) : Helpers::getClass($exception);
     $skipError = $sourceIsUrl && $exception instanceof \ErrorException && !empty($exception->skippable) ? $source . (strpos($source, '?') ? '&' : '?') . '_tracy_skip_error' : NULL;
     $lastError = $exception instanceof \ErrorException || $exception instanceof \Error ? NULL : error_get_last();
     $dump = function ($v) {
         return Dumper::toHtml($v, [Dumper::DEPTH => $this->maxDepth, Dumper::TRUNCATE => $this->maxLength, Dumper::LIVE => TRUE, Dumper::LOCATION => Dumper::LOCATION_CLASS]);
     };
     require $template;
 }
開發者ID:manGoweb,項目名稱:mnamGo,代碼行數:13,代碼來源:BlueScreen.php

示例3: defaultMailer

 /**
  * Default mailer.
  * @param  string|\Exception|\Throwable
  * @param  string
  * @return void
  * @internal
  */
 public function defaultMailer($message, $email)
 {
     $host = preg_replace('#[^\\w.-]+#', '', isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : php_uname('n'));
     $parts = str_replace(["\r\n", "\n"], ["\n", PHP_EOL], ['headers' => implode("\n", ['From: ' . ($this->fromEmail ?: "noreply@{$host}"), 'X-Mailer: Tracy', 'Content-Type: text/plain; charset=UTF-8', 'Content-Transfer-Encoding: 8bit']) . "\n", 'subject' => "PHP: An error occurred on the server {$host}", 'body' => $this->formatMessage($message) . "\n\nsource: " . Helpers::getSource()]);
     mail($email, $parts['subject'], $parts['body'], $parts['headers']);
 }
開發者ID:janlanger,項目名稱:tracy,代碼行數:13,代碼來源:Logger.php


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