Jarves\Controller\Admin\BundleManager\ManagerController::uninstallAction PHP Method

uninstallAction() public method

public uninstallAction ( string $bundle, boolean $ormUpdate = null, boolean $removeFiles = null ) : boolean
$bundle string
$ormUpdate boolean
$removeFiles boolean
return boolean
    public function uninstallAction($bundle, $ormUpdate = null, $removeFiles = null)
    {
        $ormUpdate = filter_var($ormUpdate, FILTER_VALIDATE_BOOLEAN);
        $removeFiles = filter_var($removeFiles, FILTER_VALIDATE_BOOLEAN);
        Manager::prepareName($bundle);
        $fs = $this->localFilesystem;
        $path = $this->jarves->getBundleDir($bundle);
        if (!$path) {
            throw new \Jarves\Exceptions\BundleNotFoundException();
        }
        $hasPropelModels = $fs->has($path . 'Resources/config/model.xml');
        $this->firePackageManager($bundle, 'uninstall');
        $this->deactivateAction($bundle);
        //fire update propel orm
        if ($ormUpdate && $hasPropelModels) {
            //update propel
            if ($ormUpdate) {
                $this->jarves->getEventDispatcher()->dispatch('core/bundle/schema-update', $bundle);
            }
        }
        //remove files
        if (filter_var($removeFiles, FILTER_VALIDATE_BOOLEAN)) {
            $fs->delete($path);
            if (0 === strpos($path, $this->getComposerVendorDir())) {
                $path = explode('/', $path);
                $composerName = $path[1] . '/' . $path[2];
                $this->uninstallComposerAction($composerName);
            }
        }
        return true;
    }