Remove an extension
@param string $class
@param boolean $force
@return int
@throws Exception
325138
public function actionRemove($class, $force = false)
    {
        try {
            Yii::$app->rhoone->ext->deregister($class, $force);
        } catch (\Exception $ex) {
            throw new Exception($ex->getMessage());
        }
        echo "The extension `" . $class . "` is removed.\n";
        return 0;
    }
754229
public static function off(
        string $class,
        string $name,
        ? callable $handler = null
    ): bool {
        $class = ltrim($class, '\\');
        if (
            empty(static::$_events[$name][$class])
            && empty(static::$_eventWildcards[$name][$class])
        ) {
            return false;
        }
        if ($handler === null) {
            unset(static::$_events[$name][$class]);
            if (empty(static::$_events[$name])) {
                unset(static::$_events[$name]);
            }
            unset(static::$_eventWildcards[$name][$class]);
            if (empty(static::$_eventWildcards[$name])) {
                unset(static::$_eventWildcards[$name]);
            }
            return true;
        }
        return static::remove(
            static::$_events,
            $name,
            $class,
            $handler
        ) || static::remove(
            static::$_eventWildcards,
            $name,
            $class,
            $handler
        );
    }
430411
public function delete(string $id, bool $force = false)
    {
        return $this->curl->delete($this->url.'/'.$id.'?'.http_build_query(['force' => $force]));
    }
958130
public function remove($factory = null)
    {
        if (!($factory instanceof FactoryInterface)) {
            $factory = $this->find($factory);
        }

        $this->factories = array_values(array_filter($this->factories, function($f) use ($factory) {
            return $f !== $factory;
        }));

        return $this;
    }
753818
public function removeClass($class)
    {
        if (isset($this->attr['class'])) {
            $classes = explode(' ', $this->attr['class']);
            if (in_array($class, $classes)) {
                $classes = array_diff($classes, [$class]);
            }

            if (empty($classes)) {
                unset($this->attr['class']);
            } else {
                $this->attr['class'] = implode(' ', $classes);
            }
        }
    }
467135
public function removeClass(?string $class): void
  {
    // If class is empty or no classes are set return immediately.
    if ($class===null || $class==='' || !isset($this->attributes['class'])) return;

    // Remove the class from the list of classes.
    $this->attributes['class'] = implode(' ', array_diff(explode(' ', $this->attributes['class']), [$class]));
  }
1042325
void removeExtent(String classname)
    {
        synchronized (extentTable)
        {
            // returns the super class for given extent class name
            ClassDescriptor cld = (ClassDescriptor) extentTable.remove(classname);
            if(cld != null && m_topLevelClassTable != null)
            {
                Class extClass = null;
                try
                {
                    extClass = ClassHelper.getClass(classname);
                }
                catch (ClassNotFoundException e)
                {
                    // Should not happen
                    throw new MetadataException("Can't instantiate class object for needed extent remove", e);
                }
                // remove extent from super class descriptor
                cld.removeExtentClass(classname);
                m_topLevelClassTable.remove(extClass);
                // clear map with first concrete classes, because the removed
                // extent could be such a first found concrete class
                m_firstConcreteClassMap = null;
            }
        }
    }
175566
public function remove(array $updates, $class, $append = true)
    {
        $commandClass = $this->getCommandClass('update.remove');
        $this->command = new $commandClass($updates, $class, $append);

        return $this->command;
    }
511045
public function remove(string $name, bool $force = false, bool $noprune = false)
    {
        $data = [
            'force' => $force,
            'noprune' => $noprune,
        ];

        $url = self::$base_url.'/'.$name.'?'.http_build_query($data);

        return self::$curl->delete($url);
    }
1227646
protected function remove($path, $force = false) {
		$stat = $this->stat($path);
		$stat['realpath'] = $path;
		if (!empty($stat['tmb']) && $stat['tmb'] != "1") {
			$this->rmTmb($stat['tmb']);
		}
		$this->clearcache();
		
		if (empty($stat)) {
			return $this->setError(elFinder::ERROR_RM, $this->_path($path), elFinder::ERROR_FILE_NOT_FOUND);
		}
		
		if (!$force && !empty($stat['locked'])) {
			return $this->setError(elFinder::ERROR_LOCKED, $this->_path($path));
		}
		
		if ($stat['mime'] == 'directory') {
			foreach ($this->_scandir($path) as $p) {
				$name = $this->_basename($p);
				if ($name != '.' && $name != '..' && !$this->remove($p)) {
					return false;
				}
			}
			if (!$this->_rmdir($path)) {
				return $this->setError(elFinder::ERROR_RM, $this->_path($path));
			}
			
		} else {
			if (!$this->_unlink($path)) {
				return $this->setError(elFinder::ERROR_RM, $this->_path($path));
			}
		}

		$this->removed[] = $stat;
		return true;
	}
820514
private function executeDeletions($class)
    {
        $className  = $class->name;
        $persister  = $this->getEntityPersister($className);
        $invoke     = $this->listenersInvoker->getSubscribedSystems($class, Events::postRemove);

        foreach ($this->entityDeletions as $oid => $entity) {
            if ($this->em->getClassMetadata(get_class($entity))->name !== $className) {
                continue;
            }

            $persister->delete($entity);

            unset(
                $this->entityDeletions[$oid],
                $this->entityIdentifiers[$oid],
                $this->originalEntityData[$oid],
                $this->entityStates[$oid]
            );

            // Entity with this $oid after deletion treated as NEW, even if the $oid
            // is obtained by a new entity because the old one went out of scope.
            //$this->entityStates[$oid] = self::STATE_NEW;
            if ( ! $class->isIdentifierNatural()) {
                $class->reflFields[$class->identifier[0]]->setValue($entity, null);
            }

            if ($invoke !== ListenersInvoker::INVOKE_NONE) {
                $this->listenersInvoker->invoke($class, Events::postRemove, $entity, new LifecycleEventArgs($entity, $this->em), $invoke);
            }
        }
    }
1312976
public function remove($object)
    {
        if (!is_object($object) || !($object instanceof $this->objectType)) {
            $type = (is_object($object) ? get_class($object) : gettype($object));
            throw new IllegalObjectTypeException('The value given to remove() was ' . $type . ' , however the ' . get_class($this) . ' can only handle ' . $this->objectType . ' instances.', 1517408067);
        }
        $this->entityManager->remove($object);
    }
46900
public function actionRemoveHeadword($class, $word)
    {
        $extMgr = Yii::$app->rhoone->ext;
        /* @var $extMgr \rhoone\base\ExtensionManager */
        $model = $extMgr->getModel($class);
        if (!$model) {
            throw new Exception('`' . $class . '` does not exist.');
        }
        try {
            $headword = $model->getHeadwords()->andWhere(['word' => $word])->one();
            if (!$headword) {
                echo "`$word` does not exist.";
                return 0;
            }
            echo ($headword->delete() ? "$word deleted." : "Failed to delete.");
        } catch (\Exception $ex) {
            throw new Exception($ex->getMessage());
        }
        return 0;
    }
682762
public<T> Delete<T> delete(Class<T> cls) throws APIException {
		return new Delete<T>(this,getDF(cls));
	}
375008
public function database_extensions($class)
    {
        $extensions = Config::inst()->get($class, 'database_extensions', Config::UNINHERITED);
        if ($extensions) {
            return $extensions;
        } else {
            return false;
        }
    }
474850
public function extract($extract, $force = false)
    {
        $this->extract = $extract;
        $this->extractForce = $force;

        if ($extract) {
            $this->extractCode = array(
                'constants' => array(),
                'class' => array(),
            );

            $compactor = new Php();
            $code = file_get_contents(__DIR__ . '/Extract.php');
            $code = $compactor->compact($code);
            $code = preg_replace('/\n+/', "\n", $code);
            $code = explode("\n", $code);
            $code = array_slice($code, 2);

            foreach ($code as $i => $line) {
                if ((0 === strpos($line, 'use'))
                    && (false === strpos($line, '\\'))
                ) {
                    unset($code[$i]);
                } elseif (0 === strpos($line, 'define')) {
                    $this->extractCode['constants'][] = $line;
                } else {
                    $this->extractCode['class'][] = $line;
                }
            }
        }

        return $this;
    }
618401
public function remove($force = false)
    {
        $isEmpty = $this->isEmpty();
        if ($force && !$isEmpty) {
            $it = new \RecursiveDirectoryIterator($this->dir, \RecursiveDirectoryIterator::SKIP_DOTS);
            $files = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST);
            foreach($files as $file) {
                if ($file->isDir()){
                    \rmdir($file->getRealPath());
                } else {
                    \unlink($file->getRealPath());
                }
            }

            \rmdir($this->dir);
            $this->removed = true;

            return;
        }

        if ($isEmpty) {
            \rmdir($this->dir);
            $this->removed = true;
        }
    }