Hi, who know how to replace world files? Me need unload level, replace files from directory and load level. Who know how it make right?
For first unload the level from PocketMine. Then do a recursive copy of the world you want to load in PocketMine worlds directory and then load it on PocketMine
If your plugin is just for private use, and you are on Linux, you can try PHP: $path=realpath($parh_to_world_dir);exec("rm -r -f $path");
Me need not command for console, me need make it in plugin. PHP: $path=realpath($parh_to_world_dir);exec("rm -r -f $path"); - this will delete directory, how set map files from another directory?
Use cp. It is a Linux system command not a console command. Of course, this is a lazy way. Read docs for PHP unlink() function, copy() function, scandir() function and recursive functions instead.
So, let's stop joking. Serious (not really serious) answer: http://lmgtfy.com/?q=php delete directories with files http://lmgtfy.com/?q=php copy directories with files