Ejemplo n.º 1
0
 public function moveLocalBackupToSessionContainer($preferences, $session)
 {
     if (!isset($preferences) || !isset($session)) {
         return false;
     }
     // Move the backups from the course directory into synch/sessions/sessionid/backups with the serverid appended the file name
     // Generate a new file name from the original backup file and the local server id
     $newFileName = $this->createSessionBackupFileName($preferences);
     // Generate the path to the session backup folder
     $sessionBackupPath = $this->createSessionBackupPath($session);
     $courseBackupPath = synch_Backup_controller::createBackupFilePathFromPreferences($preferences);
     // Create the folder structure if necessary
     FileSystem::createFoldersFromPath($sessionBackupPath);
     return FileSystem::moveFile($courseBackupPath, $sessionBackupPath . '/' . $newFileName);
 }