當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。