本文整理汇总了PHP中Tracy\Debugger::processException方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::processException方法的具体用法?PHP Debugger::processException怎么用?PHP Debugger::processException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracy\Debugger
的用法示例。
在下文中一共展示了Debugger::processException方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadFile
/**
* Load file
*
* @param string $file filepath
* @return string
* @throws FileNotFoundException
*/
protected function loadFile($file)
{
if (FALSE === ($content = file_get_contents($this->sourcePath . '/' . $file))) {
if ($this->throwExceptions) {
if ($this->getPresenter(FALSE)->context->params['productionMode']) {
throw new \Nette\FileNotFoundException("File '{$this->sourcePath}/{$file}' doesn't exist.");
} else {
\Tracy\Debugger::processException(new \Nette\FileNotFoundException("File '{$this->sourcePath}/{$file}' doesn't exist."));
return '';
}
}
return '';
}
foreach ($this->preFileFilters as $filter) {
$fcontent = call_user_func($filter, $content, $this, $this->sourcePath . '/' . $file);
$content = is_array($fcontent) ? $fcontent[PreFileFilter::CONTENT] : $fcontent;
foreach ($this->fileFilters as $filter) {
$content = call_user_func($filter, $content, $this, $this->sourcePath . '/' . $file);
}
}
return $content;
}
示例2: getLink
/**
* Generates link
* @return string
*/
public function getLink()
{
if ($hasArgs = func_num_args() > 0) {
$backup = $this->files;
$this->clear();
$this->addFiles(func_get_args());
}
$filenames = [];
$content = '';
if (($cnt = count($this->files)) > 0) {
if ($this->enableDirect && $cnt == 1 && $this->files[0][1] == self::COMPACT) {
$link = $this->sourceUri . $this->files[0][0];
if ($hasArgs) {
$this->files = $backup;
}
return $link;
} else {
$dc = get_declared_classes();
// u javascriptu zalezi na poradi
foreach ($this->files as $file) {
switch ($file[1]) {
case self::COMPACT:
$content .= $this->loadFile($file[0]);
break;
case self::MINIFY:
// dean edwards packer neumi cz/sk znaky!!
if (Strings::endsWith($file[0], '.min.js')) {
// already minified ?
$content .= $this->loadFile($file[0]);
} elseif (is_file($mfile = $this->sourcePath . '/' . substr($file[0], 0, -3) . '.min.js')) {
// have minified ?
$content .= file_get_contents($mfile);
} elseif (in_array('JSMin', $dc) || class_exists('JSMin')) {
// minify
$content .= \JSMin::minify($this->loadFile($file[0]));
} else {
if ($this->throwExceptions) {
if ($this->getPresenter(FALSE)->context->params['productionMode']) {
throw new \Nette\FileNotFoundException("Don't have JSMin class.");
} else {
Debugger::processException(new \Nette\FileNotFoundException("Don't have JSMin class"));
}
}
$content .= $this->loadFile($file[0]);
}
break;
case self::PACK:
if (Strings::endsWith($file[0], '.pack.js')) {
// already packed ?
$content .= $this->loadFile($file[0]);
} elseif (is_file($pfile = $this->sourcePath . '/' . substr($file[0], 0, -3) . '.pack.js')) {
// have packed ?
$content .= file_get_contents($pfile);
} elseif (in_array('JavaScriptPacker', $dc) || class_exists('JavaScriptPacker')) {
$jsp = new \JavaScriptPacker($this->loadFile($file[0]));
$content .= $jsp->pack();
} else {
if ($this->throwExceptions) {
if ($this->getPresenter(FALSE)->context->params['productionMode']) {
throw new \Nette\FileNotFoundException("Don't have JavaScriptPacker class.");
} else {
Debugger::processException(new \Nette\FileNotFoundException("Don't have JavaScriptPacker class"));
}
}
$content .= $this->loadFile($file[0]);
}
break;
default:
if ($hasArgs) {
$this->files = $backup;
}
return;
}
$filenames[] = $file[0];
}
$link = $this->getPresenter()->link(':Lohini:WebLoader:', $this->generate($filenames, $content));
if ($hasArgs) {
$this->files = $backup;
}
return $link;
}
}
if ($hasArgs) {
$this->files = $backup;
}
}