/** * 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); }
/** * 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(); } }
/** * 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(); }
function __construct() { parent::__construct(); $this->forceOverwrite = true; }