Копирует атрибуты элемента и его дочерние узлы

@param DOMElement $source
@param DOMElement $target
@return void
495468
protected function copyElement(DOMElement $source, DOMElement $target)
	{
		if ($source->hasAttributes())
		{
			$attributes = $source->attributes;
			if (!is_null($attributes))
			{
				foreach ($attributes as $attr)
				{
					$target->setAttribute($attr->name, $attr->value);
				}
			}
		}

		foreach ($source->childNodes as $child)
		{
			$target->appendChild($child->cloneNode(true));
		}
	}
480336
public function write(SpecificationRepresentationInterface $specificationRepresentation, $target)
    {
        $this->guardAgainstEmptyTarget($target);

        $renderedSpecification = $specificationRepresentation->render();

        $this->guardAgainstEmptyRenderedSpecification($target, $renderedSpecification);

        $this->createDirectoryIfNotExist($target);

        $result = file_put_contents(
            $target,
            $specificationRepresentation->render()
        );

        $this->guardAgainstNotWrittenSpecification($target, $result);
    }
140943
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        $item = new FeedItem();
        $parser->parseNodeChildren($node, $item);
        /** @var FeedInterface $target */
        $target->addItem($item);
    }
1058347
public function exposeDirectory($source, $target)
    {
        $lastException = null;
        foreach ($this->failovers as $failover) {
            try {
                $failover->exposeDirectory($source, $target);
                return; // Return on first success
            } catch (RuntimeException $lastException) {
            }
        }
        if ($lastException) {
            throw $lastException;
        }
    }
510535
public function canExtract($source, $target, ExtractionContextInterface $extractionContext)
    {
        if (!$target instanceof SupportedTarget) {
            return false;
        }

        if (is_null(self::getPrimitiveType($source))) {
            return false;
        }

        return true;
    }
731408
protected function _move($source, $targetDir, $name) {
		$sql = 'UPDATE %s SET parent_id=%d, name="%s" WHERE id=%d LIMIT 1';
		$sql = sprintf($sql, $this->tbf, $targetDir, $this->db->real_escape_string($name), $source);
		return $this->query($sql) && $this->db->affected_rows > 0 ? $source : false;
	}
951849
public function addTarget($targetName, $target)
    {
        if (isset($this->targets[$targetName])) {
            throw new BuildException("Duplicate target: $targetName");
        }
        $this->addOrReplaceTarget($targetName, $target);
    }
1073920
private function copy($source, $target)
    {
        $files = $this->listFiles($source, $target);

        foreach ($files as $newPath => $oldPath) {
            if (!file_exists($newPath)) {
                if (is_dir($oldPath)) {
                    mkdir($newPath, 0755, true);
                } else {
                    copy($oldPath, $newPath);
                }
            }
        }
    }
184855
public function move(string $sourceInterface, string $sourceName, string $targetInterface, string $targetName)
    {
        $sourceIndex = $sourceInterface . '-' . $sourceName;
        if (! isset($this->container[$sourceIndex])) {
            throw $this->unbound($sourceIndex);
        }
        $targetIndex = $targetInterface . '-' . $targetName;
        $this->container[$targetIndex] = $this->container[$sourceIndex];
        unset($this->container[$sourceIndex]);
    }
536288
public function setTarget($target)
    {
        if (is_array($target)) {
            $this->_params = array_merge($this->_params, $target);
        }
        $this->_target = $target;
    }
555840
public function map($source, &$target)
    {
        $source = static::makeSource($source);
        $writer = static::makeWriter($target);

        foreach ($this->fields as $field) {
            try {
                $writer::set($target, $field->getName(), $field->getDefinition()->getValue($source));
            } catch (SourceFieldMissingException $e) {
                if ($this->ignoreAllMissing) {
                    continue;
                }
                throw $e;
            } catch (IgnoreFieldException $e) {
                continue;
            }
        }
    }
341815
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        $url = $node->attributes->getNamedItem('href')->nodeValue;
        $type = $node->attributes->getNamedItem('type')->nodeValue;
        $length = intval($node->attributes->getNamedItem('length')->nodeValue, 10);
        $title = $node->attributes->getNamedItem('title') ? $node->attributes->getNamedItem('title')->nodeValue : basename($url);
        $enclosure = new Enclosure();
        $enclosure
            ->setType($type)
            ->setLength($length)
            ->setTitle($title)
            ->setUrl($url);
        /** @var ItemInterface $target */
        $target->addEnclosure($enclosure);
    }
617837
public function copyRecursive($source, $target, $fileFilter = '/.*/')
    {
        $filesystem = new Filesystem();
        $finder = new Finder();
        $finder->files()->in($source)->name($fileFilter);

        /** @var SplFileInfo $file */
        foreach ($finder as $file) {
            $filesystem->copy($file, $target . DIRECTORY_SEPARATOR . $file->getRelativePathname());
        }
    }
616702
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        /** @var ItemInterface $target */
        $target->setLastModified(\DateTime::createFromFormat(\DateTime::RSS, $node->nodeValue));
    }
803510
public function moveFile($source, $target, $file)
    {
        if (file_exists($source.$file)) {
            rename($source.$file, $target.$file);
        }
    }
1322574
public function sync($origin, $target)
    {
        $command = $this->getCommand($origin, $target);

        $command->execute($this->showOutput);
    }
184213
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        $target->{$this->setterName}($node->attributes->getNamedItem('href')->nodeValue);
    }