Move a file or directory.

@since 0.1.0

@param string $source      The source path.
@param string $destination The destination path.

@return bool True if the file was moved, false otherwise.
433051
public function move( $source, $destination ) {

		if ( false === $this->copy( $source, $destination ) ) {
			return false;
		}

		$this->delete( $source );

		return true;
	}
937569
public function MoveFolder($source,$dest){
        $this->CopyFiles($source,$dest);
        $this->RemoveFiles($source);
    }
493639
public function move(FilesystemFolder $destination) {

		// already in destination folder, nothing to do

		if($destination !== $this->folder) {

			$oldpath	= $this->folder->getPath() . $this->filename;
			$newpath	= $destination->getPath() . $this->filename;
	
			if(@rename($oldpath, $newpath)) {

				$this->clearCacheEntries();
				
				// set new folder reference

				$this->folder = $destination;
	
				// re-read fileinfo

				$this->fileInfo	= new \SplFileInfo($newpath);

				self::$instances[$newpath] = $this;
				unset(self::$instances[$oldpath]);

				// @todo: check necessity of chmod
	
				@chmod($newpath, 0666 & ~umask());
				
			}
	
			else {
				throw new FilesystemFileException("Moving from '$oldpath' to '$newpath' failed.", FilesystemFileException::FILE_RENAME_FAILED);
			}

		}

		return $this;
	}
1309237
public function safeRename($source, $destination)
    {
        $isRenamed = @rename($source, $destination);
        if ($isRenamed) {
            return;

        }

        // copy to the target filesystem
        $tempFileOnSameFS = "$destination.tmp";

        $isCopied = copy($source, $tempFileOnSameFS);
        if (! $isCopied) {
            throw new FileException(
                "failed to copy $source to $tempFileOnSameFS."
            );

        }

        $isUnlinked = unlink($source);
        if (! $isUnlinked) {
            trigger_error("Failed to unlink $source.");

        }

        $isRenamed = rename($tempFileOnSameFS, $destination);
        if (! $isRenamed) {
            throw new FileException(
                "failed to rename $tempFileOnSameFS to $destination."
            );

        }
    }
533276
public function moveDirectory( $source, $destination )
    {
        $path = explode( DS, $source );

        $destination = $destination . DS . $path[ count( $path ) - 1 ];

        $result = $this->copyDirectory( $source, $destination, TRUE );

        if ( TRUE === $result )
        {
            $result = $this->deleteDirectory( $source );
        }

        return $result;
    }
994359
public function copyDirectory($directory, $destination)
    {
        if (! $this->isDirectory($directory)) {
            return false;
        }

        if (! $this->files->isDirectory($destination)) {
            $this->makeDirectory($destination, 0777, true);
        }

        $items = new FilesystemIterator($directory, FilesystemIterator::SKIP_DOTS);

        foreach ($items as $item) {
            $target = $destination .DS .$item->getBasename();

            if ($item->isDir()) {
                if (! $this->copyDirectory($item->getPathname(), $target)) {
                    return false;
                }

                continue;
            }

            // The current item is a file.
            if ($this->files->exists($target) && ! $this->option('force')) {
                continue;
            } else if (! $this->files->copy($item->getPathname(), $target)) {
                return false;
            }
        }

        return true;
    }
4702
public function extend($source, $destination)
    {
        foreach($source as $key => $value)
        {
            $destination->{$key} = $value;
        }

        return $destination;
    }
366409
public function moveDirectory( $from, $to, $overwrite = false )
	{
		if ( $overwrite && $this->isDirectory( $to ) )
		{
			$this->deleteDirectory( $to );

			$this->copyDirectory( $from, $to );

			$this->deleteDirectory( $from );

			return true;
		}

		return @rename( $from, $to ) === true;
	}
1220028
public function move($target, $source)
    {
        $this->copy($target, $source);

        $this->delete($target);
    }
385639
protected function _move($source, $targetDir, $name) {
		$target = $targetDir.DIRECTORY_SEPARATOR.$name;
		return ftp_rename($this->connect, $source, $target) ? $target : false;
	}
1134964
private function copyDirectory(
        FilesystemInterface $source,
        FilesystemInterface $destination,
        $path
    ) {
        foreach ($source->listFiles($path) as $filePath) {
            $this->copyFile($source, $destination, $filePath);
        }
    }
273453
public function move(string $destination): Response {
        $uri         = $this->fedora->sanitizeUri($this->uri);
        $destination = $this->fedora->sanitizeUri($destination);
        $request     = new Request('MOVE', $uri, ['Destination' => $destination]);
        $response    = $this->fedora->sendRequest($request);
        $cache       = $this->fedora->getCache();
        $cache->deleteById($this->getId());
        $cache->add($this);
        return $response;
    }
1078178
protected function _move($source, $targetDir, $name) {
		$target = $this->_normpath($targetDir.'/'.$name);
		try {
			$this->dropbox->move($source, $target);
		} catch (Dropbox_Exception $e) {
			return $this->setError('Dropbox error: '.$e->getMessage());
		}
		$this->deltaCheck();
		return $target;
	}
392045
public function copy($source, $dest)
    {
        // Simple copy for a file
        if (is_file($source)) {
            if (file_exists($dest) && (!empty($this->options['overwrite']) || fileatime($source) < fileatime($dest))) {
                return true;
            }

            return copy($source, $dest);
        }

        // Make destination directory
        if (!is_dir($dest)) {
            @mkdir($dest, 0777, true);
        }

        // Loop through the folder
        $dir = dir($source);
        while (false !== $entry = $dir->read()) {
            // Skip pointers
            if ($entry == '.' || $entry == '..') {
                continue;
            }

            // Deep copy directories
            if ($dest !== "$source/$entry") {
                $this->copy("$source/$entry", "$dest/$entry");
            }
        }

        // Clean up
        $dir->close();

        return true;
    }
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);
                }
            }
        }
    }
110281
public function copy( $source, $destination ) {

		$source = $this->get_file( $source );

		if ( false === $source ) {
			return false;
		}

		$destination_parent = $this->get_file( dirname( $destination ) );
		$filename = basename( $destination );

		if ( false === $destination_parent ) {
			return false;
		}

		$destination_parent->contents->$filename = clone $source;

		return true;
	}
834143
protected function isDestinationDifferentThanSource($source, $destination)
    {
        $path_parts = pathinfo($destination);
        $this->isEqual($source, $path_parts['dirname']);
    }