Pimcore\ExtensionManager::delete PHP Method

delete() public static method

public static delete ( $id, $type )
$id
$type
    public static function delete($id, $type)
    {
        if ($type == "plugin") {
            $pluginDir = PIMCORE_PLUGINS_PATH . "/" . $id;
            if (is_writeable($pluginDir)) {
                recursiveDelete($pluginDir, true);
            }
        } elseif ($type == "brick") {
            $brickDirs = self::getBrickDirectories();
            $brickDir = $brickDirs[$id];
            if (is_writeable($brickDir)) {
                recursiveDelete($brickDir, true);
            }
        }
    }

Usage Example

Example #1
0
 public function deleteAction()
 {
     $type = $this->getParam("type");
     $id = $this->getParam("id");
     ExtensionManager::delete($id, $type);
     $this->_helper->json(array("success" => true));
 }