private function mirrorFiles() { $this->stateFolder = BASEPATH . '/wpmirror'; if (isset($this->remoteSettings->stateFolder)) { $this->stateFolder = $this->remoteSettings->stateFolder; } $localChanges = $this->getModifiedLocalFiles(); $remoteChanges = $this->getModifiedRemoteFiles(); $missingLocal = $this->getMissingLocalFiles(); // Merge the changes together foreach ($localChanges as $file => $change) { if (!isset($remoteChanges[$file])) { $remoteChanges[$file] = $change; } } foreach ($missingLocal as $file => $change) { if (!isset($remoteChanges[$file])) { $remoteChanges[$file] = $change; } } // Get the changes from the remote server: $this->remote->getFiles($remoteChanges); }