static function MoveFile($from_file,$to_file,&$error = null,&$error_str = null){
		$error = false;
		$error_str = "";

		settype($from_file,"string");
		settype($to_file,"string");

		if(is_dir($to_file) && file_exists($from_file) && !is_dir($from_file)){
			// copying a file to an existing directory
			preg_match('/([^\/]+)$/',$from_file,$matches);
			$to_file .= "/$matches[1]";
			
		}elseif(is_dir($to_file) && file_exists($from_file) && is_dir($from_file)){
			// copying a directory to an existing directory
			preg_match('/([^\/]+)\/*$/',$from_file,$matches);
			$to_file .= "/$matches[1]";
		}

		if($from_file==$to_file){
			$error = true;
			$error_str = "from_file and to_file are the same files";
			return 0;
		}

		$_stat = rename($from_file,$to_file);
		if(!$_stat){
			$error = true;
			$error_str = "can't rename $from_file to $to_file";
			return 0;
		}	

		return 1;
	}
static function MoveFile($from_file,$to_file,&$error = null,&$error_str = null){
		$error = false;
		$error_str = "";

		settype($from_file,"string");
		settype($to_file,"string");

		if(is_dir($to_file) && file_exists($from_file) && !is_dir($from_file)){
			// copying a file to an existing directory
			preg_match('/([^\/]+)$/',$from_file,$matches);
			$to_file .= "/$matches[1]";
			
		}elseif(is_dir($to_file) && file_exists($from_file) && is_dir($from_file)){
			// copying a directory to an existing directory
			preg_match('/([^\/]+)\/*$/',$from_file,$matches);
			$to_file .= "/$matches[1]";
		}

		if($from_file==$to_file){
			$error = true;
			$error_str = "from_file and to_file are the same files";
			return 0;
		}

		$_stat = rename($from_file,$to_file);
		if(!$_stat){
			$error = true;
			$error_str = "can't rename $from_file to $to_file";
			return 0;
		}	

		return 1;
	}
static function MoveFile ( $ from_file , $ to_file , & $ error = null , & $ error_str = null ) { $ error = false ; $ error_str = "" ; settype ( $ from_file , "string" ) ; settype ( $ to_file , "string" ) ; if ( is_dir ( $ to_file ) && file_exists ( $ from_file ) && ! is_dir ( $ from_file ) ) { // copying a file to an existing directory preg_match ( '/([^\/]+)$/' , $ from_file , $ matches ) ; $ to_file .= "/$matches[1]" ; } elseif ( is_dir ( $ to_file ) && file_exists ( $ from_file ) && is_dir ( $ from_file ) ) { // copying a directory to an existing directory preg_match ( '/([^\/]+)\/*$/' , $ from_file , $ matches ) ; $ to_file .= "/$matches[1]" ; } if ( $ from_file == $ to_file ) { $ error = true ; $ error_str = "from_file and to_file are the same files" ; return 0 ; } $ _stat = rename ( $ from_file , $ to_file ) ; if ( ! $ _stat ) { $ error = true ; $ error_str = "can't rename $from_file to $to_file" ; return 0 ; } return 1 ; }
Moves a file or a directory

```
Files::MoveFile("/path/to/file","/path/to/another/file",$error,$error_str);
Files::MoveFile("/path/to/file","/path/to/directory/",$error,$error_str);
Files::MoveFile("/path/to/directory/","/path/to/another/directory/",$error,$error_str);
```

@param string $from_file Source file
@param string $to_file Target file
@param boolean &$error Error flag
@param string &$error_str Error description
@return int number of moved files; ie. on success return 1
Moves a file or a directory