Exemple #1
0
 /**
  * @param User     $user
  * @param FilePath $relativeFilePath
  * @param string   $commitMessage
  *
  * @throws \Exception
  */
 public function deleteFile(User $user, FilePath $relativeFilePath, $commitMessage)
 {
     if (empty($commitMessage)) {
         throw new \Exception('Commit message must not be empty');
     }
     $this->createLock($user, $relativeFilePath);
     $this->gitRepository->removeAndCommit($this->getAuthor($user), $commitMessage, $relativeFilePath);
     $this->removeLock($user, $relativeFilePath);
     if (StringUtils::endsWith($relativeFilePath->getName(), '.md')) {
         $this->eventDispatcher->dispatch('ddr.gitki.wiki.markdown_document.deleted', new MarkdownDocumentDeletedEvent($relativeFilePath, $user->getEmail(), time(), $commitMessage));
     }
 }