src/php/Webforge/Common/System/File.php
public function move(File $fileDestination, $overwrite = FALSE) {
    if (!$this->exists())
      throw new Exception('Quelle von move existiert nicht. '.$this);

    if ($fileDestination->exists() && !$overwrite) {
      throw new Exception('Das Ziel von move existiert bereits'.$fileDestination);
    }

    if (!$fileDestination->getDirectory()->exists()) {
      throw new Exception('Das ZielVerzeichnis von move existiert nicht: '.$fileDestination->getDirectory());
    }
   
    if ($fileDestination->exists() && $overwrite && substr(PHP_OS, 0, 3) == 'WIN') {
      $fileDestination->delete();
    }
    
    $ret = rename((string) $this, (string) $fileDestination);
    
    if ($ret) {
      $this->setDirectory($fileDestination->getDirectory());
      $this->setName($fileDestination->getName());
    }

    return $ret;
  }
public function move(File $fileDestination, $overwrite = FALSE) {
    if (!$this->exists())
      throw new Exception('Quelle von move existiert nicht. '.$this);

    if ($fileDestination->exists() && !$overwrite) {
      throw new Exception('Das Ziel von move existiert bereits'.$fileDestination);
    }

    if (!$fileDestination->getDirectory()->exists()) {
      throw new Exception('Das ZielVerzeichnis von move existiert nicht: '.$fileDestination->getDirectory());
    }
   
    if ($fileDestination->exists() && $overwrite && substr(PHP_OS, 0, 3) == 'WIN') {
      $fileDestination->delete();
    }
    
    $ret = rename((string) $this, (string) $fileDestination);
    
    if ($ret) {
      $this->setDirectory($fileDestination->getDirectory());
      $this->setName($fileDestination->getName());
    }

    return $ret;
  }
public function move ( File $ fileDestination , $ overwrite = FALSE ) { if ( ! $ this -> exists ( ) ) throw new Exception ( 'Quelle von move existiert nicht. ' . $ this ) ; if ( $ fileDestination -> exists ( ) && ! $ overwrite ) { throw new Exception ( 'Das Ziel von move existiert bereits' . $ fileDestination ) ; } if ( ! $ fileDestination -> getDirectory ( ) -> exists ( ) ) { throw new Exception ( 'Das ZielVerzeichnis von move existiert nicht: ' . $ fileDestination -> getDirectory ( ) ) ; } if ( $ fileDestination -> exists ( ) && $ overwrite && substr ( PHP_OS , 0 , 3 ) == 'WIN' ) { $ fileDestination -> delete ( ) ; } $ ret = rename ( ( string ) $ this , ( string ) $ fileDestination ) ; if ( $ ret ) { $ this -> setDirectory ( $ fileDestination -> getDirectory ( ) ) ; $ this -> setName ( $ fileDestination -> getName ( ) ) ; } return $ ret ; }
Moves the File to another file and changes the internal state to the destination

after this command
(string) $fileDestination-> === (string) $this
is true

@param File $fileDestination
@return bool
Moves the File to another file and changes the internal state to the destination