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


PHP PhingFile::isLink方法代码示例

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


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

示例1: _checkFile1

 private function _checkFile1(PhingFile $file)
 {
     // Resolve symbolic links
     if ($this->followSymlinks && $file->isLink()) {
         $file = new PhingFile($file->getLinkTarget());
     }
     if ($this->type !== null) {
         if ($this->type === "dir") {
             return $file->isDirectory();
         } else {
             if ($this->type === "file") {
                 return $file->isFile();
             }
         }
     }
     return $file->exists();
 }
开发者ID:ngroot,项目名称:phing,代码行数:17,代码来源:AvailableTask.php

示例2: copy

 /**
  * Copy a file, takes care of symbolic links
  *
  * @param PhingFile $src Source path and name file to copy.
  * @param PhingFile $dest Destination path and name of new file.
  *
  * @return void     
  * @throws Exception if file cannot be copied.
  */
 function copy(PhingFile $src, PhingFile $dest)
 {
     global $php_errormsg;
     if (!$src->isLink()) {
         return parent::copy($src, $dest);
     }
     $srcPath = $src->getAbsolutePath();
     $destPath = $dest->getAbsolutePath();
     $linkTarget = $src->getLinkTarget();
     if (false === @symlink($linkTarget, $destPath)) {
         $msg = "FileSystem::copy() FAILED. Cannot create symlink from {$destPath} to {$linkTarget}.";
         throw new Exception($msg);
     }
 }
开发者ID:halfer,项目名称:Meshing,代码行数:23,代码来源:UnixFileSystem.php

示例3: addFilesetsToArchive

 /**
  * @param $zip
  */
 private function addFilesetsToArchive($zip)
 {
     foreach ($this->filesets as $fs) {
         $fsBasedir = null != $this->baseDir ? $this->baseDir : $fs->getDir($this->project);
         $files = $fs->getFiles($this->project, $this->includeEmpty);
         for ($i = 0, $fcount = count($files); $i < $fcount; $i++) {
             $f = new PhingFile($fsBasedir, $files[$i]);
             $pathInZip = $this->prefix . $f->getPathWithoutBase($fsBasedir);
             $pathInZip = str_replace('\\', '/', $pathInZip);
             if ($this->ignoreLinks && $f->isLink()) {
                 continue;
             } elseif ($f->isDirectory()) {
                 if ($pathInZip != '.') {
                     $zip->addEmptyDir($pathInZip);
                 }
             } else {
                 $zip->addFile($f->getAbsolutePath(), $pathInZip);
             }
             $this->log("Adding " . $f->getPath() . " as " . $pathInZip . " to archive.", Project::MSG_VERBOSE);
         }
     }
 }
开发者ID:alangalipaud,项目名称:ProjetQCM,代码行数:25,代码来源:ZipTask.php

示例4: _checkFile1

 /**
  * @param PhingFile $file
  * @return bool
  * @throws IOException
  */
 private function _checkFile1(PhingFile $file)
 {
     // Resolve symbolic links
     if ($this->followSymlinks && $file->isLink()) {
         $linkTarget = new PhingFile($file->getLinkTarget());
         if ($linkTarget->isAbsolute()) {
             $file = $linkTarget;
         } else {
             $fs = FileSystem::getFileSystem();
             $file = new PhingFile($fs->resolve($fs->normalize($file->getParent()), $fs->normalize($file->getLinkTarget())));
         }
     }
     if ($this->type !== null) {
         if ($this->type === "dir") {
             return $file->isDirectory();
         } else {
             if ($this->type === "file") {
                 return $file->isFile();
             }
         }
     }
     return $file->exists();
 }
开发者ID:Ingewikkeld,项目名称:phing,代码行数:28,代码来源:AvailableTask.php

示例5: isSelected

 /**
  * The heart of the matter. This is where the selector gets to decide
  * on the inclusion of a file in a particular fileset.
  *
  * @param  PhingFile $basedir  the base directory the scan is being done from
  * @param  string    $filename is the name of the file to check
  * @param  PhingFile $file     is a PhingFile object the selector can use
  * @return boolean   Whether the file should be selected or not
  */
 public function isSelected(PhingFile $basedir, $filename, PhingFile $file)
 {
     // throw BuildException on error
     $this->validate();
     if ($file->isLink()) {
         if ($this->type == 'link') {
             return true;
         }
         $this->log($file->getAbsolutePath() . " is a link, proceeding with " . $file->getCanonicalPath() . " instead.", Project::MSG_DEBUG);
         $file = new PhingFile($file->getCanonicalPath());
     }
     if ($file->isDirectory()) {
         return $this->type === 'dir';
     } else {
         return $this->type === 'file';
     }
 }
开发者ID:xxspartan16,项目名称:BMS-Market,代码行数:26,代码来源:TypeSelector.php


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