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


PHP PhingFile::toString方法代码示例

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


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

示例1: main

 /**
  * {@inheritdoc}
  *
  * @throws BuildException
  * @throws IOException
  */
 public function main()
 {
     if ($this->dir == null) {
         throw new BuildException("missing dir");
     }
     if ($this->name == null) {
         throw new BuildException("missing name");
     }
     if ($this->pathRefId == null) {
         throw new BuildException("missing pathrefid");
     }
     if (!$this->dir->isDirectory()) {
         throw new BuildException($this->dir->toString() . " is not a directory");
     }
     $path = $this->getProject()->getReference($this->pathRefId);
     if ($path == null) {
         throw new BuildException("Unknown reference " . $this->pathRefId);
     }
     if (!$path instanceof Path) {
         throw new BuildException($this->pathRefId . " is not a path");
     }
     $sources = $path->listPaths();
     $fileSet = new FileSet();
     $fileSet->setProject($this->getProject());
     $fileSet->setDir($this->dir);
     $fileUtils = new FileUtils();
     $dirNormal = $fileUtils->normalize($this->dir->getAbsolutePath());
     $dirNormal = rtrim($dirNormal, PhingFile::$separator) . PhingFile::$separator;
     $atLeastOne = false;
     for ($i = 0; $i < count($sources); ++$i) {
         $sourceFile = new PhingFile($sources[$i]);
         if (!$sourceFile->exists()) {
             continue;
         }
         $includePattern = $this->getIncludePattern($dirNormal, $sourceFile);
         if ($includePattern === false && !$this->ignoreNonRelative) {
             throw new BuildException($sources[$i] . " is not relative to " . $this->dir->getAbsolutePath());
         }
         if ($includePattern === false) {
             continue;
         }
         $fileSet->createInclude()->setName($includePattern);
         $atLeastOne = true;
     }
     if (!$atLeastOne) {
         $fileSet->createInclude()->setName("a:b:c:d//THis si &&& not a file !!! ");
     }
     $this->getProject()->addReference($this->name, $fileSet);
 }
开发者ID:nhallpot,项目名称:CSCrew2015-back,代码行数:55,代码来源:PathToFileSet.php

示例2: transform

 function transform()
 {
     $dir = new PhingFile($this->toDir);
     if (!$dir->exists()) {
         throw new BuildException("Directory '" . $this->toDir . "' does not exist");
     }
     $xslfile = $this->getStyleSheet();
     $xsl = new DOMDocument();
     $xsl->load($xslfile->getAbsolutePath());
     $proc = new XSLTProcessor();
     $proc->importStyleSheet($xsl);
     ExtendedFileStream::registerStream();
     // no output for the framed report
     // it's all done by extension...
     $proc->setParameter('', 'output.dir', $dir->toString());
     $proc->transformToXML($this->document);
     ExtendedFileStream::unregisterStream();
 }
开发者ID:hkilter,项目名称:OpenSupplyChains,代码行数:18,代码来源:CoverageReportTransformer.php

示例3: transform

 /**
  * Transforms the DOM document
  */
 protected function transform(DOMDocument $document)
 {
     $dir = new PhingFile($this->toDir);
     if (!$dir->exists()) {
         throw new BuildException("Directory '" . $this->toDir . "' does not exist");
     }
     $xslfile = $this->getStyleSheet();
     $xsl = new DOMDocument();
     $xsl->load($xslfile->getAbsolutePath());
     $proc = new XSLTProcessor();
     $proc->importStyleSheet($xsl);
     if ($this->format == "noframes") {
         $writer = new FileWriter(new PhingFile($this->toDir, "phpunit-noframes.html"));
         $writer->write($proc->transformToXML($document));
         $writer->close();
     } else {
         ExtendedFileStream::registerStream();
         // no output for the framed report
         // it's all done by extension...
         $dir = new PhingFile($this->toDir);
         $proc->setParameter('', 'output.dir', $dir->toString());
         $proc->transformToXML($document);
         ExtendedFileStream::unregisterStream();
     }
 }
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:28,代码来源:PHPUnitReportTask.php


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