Services\Synchronize::copyToRestore PHP Method

copyToRestore() public method

Copy the backup file received from the post data to the restore folder
public copyToRestore ( Input $input ) : string
$input Input "The post input data"
return string "Filename"
    public function copyToRestore($input)
    {
        File::cleanDirectory(restore_path());
        $file = $input['file'];
        $destinationPath = restore_path();
        $filename = $file->getClientOriginalName();
        // $extension = $file->getClientOriginalExtension();
        $uploadSuccess = $file->move($destinationPath, $filename);
        if ($uploadSuccess) {
            $file = $destinationPath . '/' . $filename;
            return $file;
        } else {
            return false;
        }
    }

Usage Example

Exemplo n.º 1
0
 public function postRestore()
 {
     Sentry::logout();
     $synchronizer = new Synchronize($this);
     $restore_file = $synchronizer->copyToRestore(Input::all());
     $synchronizer->restore($restore_file);
     return Redirect::to('/');
 }
All Usage Examples Of Services\Synchronize::copyToRestore