Автор: Andreas Aderhold, andi@binarycloud.com
Наследование: extends Task
Пример #1
0
 /**
  * Method executed to copy all the files. After copy it intercepts the file list
  * and calculate the checksum for each file, storing in the specified file.
  *
  * @return void
  */
 protected function doWork()
 {
     parent::doWork();
     $checksumFile = fopen($this->checksumFile, 'a');
     // Run the file map calculating the checksum
     foreach ($this->fileCopyMap as $source => $dest) {
         $relativePath = str_replace($this->addTrailingSlash($this->destDir), '', $dest);
         $sum = sha1_file($source);
         fwrite($checksumFile, $relativePath . ':' . $sum . "\n");
     }
     fclose($checksumFile);
 }
Пример #2
0
 /**
  * Validates attributes coming in from XML
  *
  * @access  private
  * @return  void
  * @throws  BuildException
  */
 protected function validateAttributes()
 {
     if ($this->file !== null && $this->file->isDirectory()) {
         if ($this->destFile !== null && $this->destDir !== null || $this->destFile === null && $this->destDir === null) {
             throw new BuildException("One and only one of tofile and todir must be set.");
         }
         if ($this->destFile === null) {
             $this->destFile = new PhingFile($this->destDir, $this->file->getName());
         }
         if ($this->destDir === null) {
             $this->destDir = $this->destFile->getParentFile();
         }
         $this->completeDirMap[$this->file->getAbsolutePath()] = $this->destFile->getAbsolutePath();
         $this->file = null;
     } else {
         parent::validateAttributes();
     }
 }
Пример #3
0
 /**
  * Set any XSLT Param and invoke CopyTask::main()
  * @see CopyTask::main()
  */
 function main()
 {
     $this->log("Doing XSLT transformation using stylesheet " . $this->xsltFilter->getStyle(), Project::MSG_VERBOSE);
     $this->xsltFilter->setParams($this->parameters);
     parent::main();
 }
Пример #4
0
 function __construct()
 {
     parent::__construct();
     $this->forceOverwrite = true;
 }