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


PHP Debugger::processException方法代码示例

本文整理汇总了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;
 }
开发者ID:lohini,项目名称:webloader,代码行数:29,代码来源:WebLoader.php

示例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;
     }
 }
开发者ID:lohini,项目名称:webloader,代码行数:90,代码来源:JsLoader.php


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