I need to copy all folders and files in directory, but I need to replace just files to another folder and delete source folder.
F.e.
core/ <---- OLD FOLDER (should be replaced with new version)
core/update/update_1.0.1/core <------- NEW VERSION
My idea was something like:
rename(realpath(ROOTPATH . 'core/'),realpath(ROOTPATH . 'core/update/update_1.0.1/core/');
//AFTER THAT
unlink(ROOTPATH . 'core/update/update_1.0.1/core/');
But with my code, actually I get the error: Access denied (code: 5)
Can anyone help? Thanks