本文整理汇总了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';
}
示例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;
}
示例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']);
}