public function move($sourcePath, $destinationPath)
    {
        list($sourceDir) = Uri\split($sourcePath);
        list($destinationDir, $destinationName) = Uri\split($destinationPath);

        if ($sourceDir === $destinationDir) {
            // If this is a 'local' rename, it means we can just trigger a rename.
            $sourceNode = $this->getNodeForPath($sourcePath);
            $sourceNode->setName($destinationName);
        } else {
            $newParentNode = $this->getNodeForPath($destinationDir);
            $moveSuccess = false;
            if ($newParentNode instanceof IMoveTarget) {
                // The target collection may be able to handle the move
                $sourceNode = $this->getNodeForPath($sourcePath);
                $moveSuccess = $newParentNode->moveInto($destinationName, $sourcePath, $sourceNode);
            }
            if (!$moveSuccess) {
                $this->copy($sourcePath, $destinationPath);
                $this->getNodeForPath($sourcePath)->delete();
            }
        }
        $this->markDirty($sourceDir);
        $this->markDirty($destinationDir);
    }
public function move($sourcePath, $destinationPath)
    {
        list($sourceDir) = Uri\split($sourcePath);
        list($destinationDir, $destinationName) = Uri\split($destinationPath);

        if ($sourceDir === $destinationDir) {
            // If this is a 'local' rename, it means we can just trigger a rename.
            $sourceNode = $this->getNodeForPath($sourcePath);
            $sourceNode->setName($destinationName);
        } else {
            $newParentNode = $this->getNodeForPath($destinationDir);
            $moveSuccess = false;
            if ($newParentNode instanceof IMoveTarget) {
                // The target collection may be able to handle the move
                $sourceNode = $this->getNodeForPath($sourcePath);
                $moveSuccess = $newParentNode->moveInto($destinationName, $sourcePath, $sourceNode);
            }
            if (!$moveSuccess) {
                $this->copy($sourcePath, $destinationPath);
                $this->getNodeForPath($sourcePath)->delete();
            }
        }
        $this->markDirty($sourceDir);
        $this->markDirty($destinationDir);
    }
public function move ( $ sourcePath , $ destinationPath ) { list ( $ sourceDir ) = Uri \ split ( $ sourcePath ) ; list ( $ destinationDir , $ destinationName ) = Uri \ split ( $ destinationPath ) ; if ( $ sourceDir === $ destinationDir ) { // If this is a 'local' rename, it means we can just trigger a rename. $ sourceNode = $ this -> getNodeForPath ( $ sourcePath ) ; $ sourceNode -> setName ( $ destinationName ) ; } else { $ newParentNode = $ this -> getNodeForPath ( $ destinationDir ) ; $ moveSuccess = false ; if ( $ newParentNode instanceof IMoveTarget ) { // The target collection may be able to handle the move $ sourceNode = $ this -> getNodeForPath ( $ sourcePath ) ; $ moveSuccess = $ newParentNode -> moveInto ( $ destinationName , $ sourcePath , $ sourceNode ) ; } if ( ! $ moveSuccess ) { $ this -> copy ( $ sourcePath , $ destinationPath ) ; $ this -> getNodeForPath ( $ sourcePath ) -> delete ( ) ; } } $ this -> markDirty ( $ sourceDir ) ; $ this -> markDirty ( $ destinationDir ) ; }
Moves a file from one location to another.

@param string $sourcePath      The path to the file which should be moved
@param string $destinationPath The full destination path, so not just the destination parent node

@return int
Moves a file from one location to another .