protected function _addFile($file, $sourcePath, $targetPath, $targetFile = null)
{
$result = false;
if (!is_file($targetPath . $file) || !empty($this->params['overwrite'])) {
$result = true;
if (empty($this->params['dry-run'])) {
if ($targetFile === null) {
$targetFile = $file;
}
$targetPathName = $targetPath . dirname($targetFile);
if (!is_dir($targetPathName)) {
mkdir($targetPathName, 0755, true);
}
$result = copy($sourcePath . $file, $targetPath . $targetFile);
}
$this->out('Adding ' . $file, 1, Shell::VERBOSE);
}
return $result;
}