/**
  * Remove an extension (delete the directory)
  *
  * @param string $extension
  * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
  * @return void
  */
 public function removeExtension($extension)
 {
     $absolutePath = $this->filehandlingUtility->getAbsoluteExtensionPath($extension);
     if ($this->filehandlingUtility->isValidExtensionPath($absolutePath)) {
         $this->filehandlingUtility->removeDirectory($absolutePath);
     } else {
         throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('No valid extension path given.', 1342875724);
     }
 }
Beispiel #2
0
 /**
  * Remove an extension (delete the directory)
  *
  * @param string $extension
  * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
  * @return void
  */
 public function removeExtension($extension)
 {
     $absolutePath = $this->fileHandlingUtility->getAbsoluteExtensionPath($extension);
     if ($this->fileHandlingUtility->isValidExtensionPath($absolutePath)) {
         if ($this->packageManager->isPackageAvailable($extension)) {
             // Package manager deletes the extension and removes the entry from PackageStates.php
             $this->packageManager->deletePackage($extension);
         } else {
             // The extension is not listed in PackageStates.php, we can safely remove it
             $this->fileHandlingUtility->removeDirectory($absolutePath);
         }
     } else {
         throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('No valid extension path given.', 1342875724);
     }
 }