[BUGFIX] EM: Uploading extensions fails with Fatal Errors
[Packages/TYPO3.CMS.git] / typo3 / sysext / em / classes / connection / class.tx_em_connection_extdirectserver.php
index 1df96ad..339a8d9 100644 (file)
@@ -1454,6 +1454,25 @@ class tx_em_Connection_ExtDirectServer {
                $install->forceDBupdates($extensionKey, $installedList[$extensionKey]);
        }
 
+       /**
+        * Disables (uninstalls) an extension
+        *
+        * @param string $extensionKey Extension to uninstall
+        * @return void
+        */
+       public function disableExtension($extensionKey) {
+               /** @var tx_em_Extensions_List */
+               $this->extensionList = t3lib_div::makeInstance('tx_em_Extensions_List', $this);
+               /** @var $install tx_em_Install */
+               $install = t3lib_div::makeInstance('tx_em_Install', $this);
+
+               list($installedList,) = $this->extensionList->getInstalledExtensions();
+               $newExtensionList = $this->extensionList->removeExtFromList($extensionKey, $installedList);
+
+               $install->writeNewExtensionList($newExtensionList);
+               tx_em_Tools::refreshGlobalExtList();
+       }
+
        /**
         * Reset all states for current user
         *