/** * Rename a file * @param string $oldFilePath the path to the file to be renamed * @param string $newFilePath the new path to give it */ public function setRenameFile($oldFilePath, $newFilePath) { $this->_listeners[] = $this->_operationsFactory->getOperation('Scisr_Operations_RenameFile', $oldFilePath, $newFilePath); if (!file_exists($oldFilePath)) { $msg = 'does not exist, so will not be moved.'; } else { if (!is_writeable($oldFilePath)) { $msg = 'could not be moved.'; } else { $this->_changeRegistry->addRename($oldFilePath, $newFilePath); } } if (isset($msg)) { $msg = "File \"{$oldFilePath}\" " . $msg; $this->sendOutput($msg); } }