Removes the expired data values.
@param bool $force whether to enforce the garbage collection regardless of [[gcProbability]].
Defaults to false, meaning the actual deletion happens with the probability as specified by [[gcProbability]].
335088
public function gc($force = false)
    {
        if ($force || mt_rand(0, 1000000) < $this->gcProbability) {
            Yii::info(static::className()." GC begin");
            $i = 100000;
            $table = $this->tableInstance;
            foreach ($table as $key => $column) {
                if($column['expire'] < time() || true){
                    $this->deleteValue($key);
                }
                $i--;
                if($i <= 0){
                    \Swoole\Coroutine::sleep($this->gcSleep);
                    $i = 100000;
                }
            }
            Yii::info(static::className()." GC end.");
        }
    }
71332
public function purge(bool $force, OutputInterface $output)
    {
        $tables = $this->db->getSchemaManager()->listTableNames();
        foreach ($tables as $table) {
            $output->writeln("<info>Dropping table $table</info>");
            if ($force) {
                $this->db->getSchemaManager()->dropTable($table);
            }
        }

        if (!$force) {
            $output->writeln('<comment>No query was run, use the --force option to run the queries</comment>');
        } else {
            $output->writeln('<comment>Queries were successfully run against the database</comment>');
        }

        $this->update($force, $output);
    }
25239
public function delete($force = false)
    {
        $this->getParent()->channelDelete($this->getId(), $force);

        unset($this);
    }
724620
public function beforeDelete( $forced = false )
  {
    try {
        if($this->resourceflow){
            $this->resourceflow->delete();
        }
    } catch(Execption $e) {}

    return true;
  }
176481
protected function remove($path, $force = false) {
		$stat = $this->stat($path);
		
		if (empty($stat)) {
			return $this->setError(elFinder::ERROR_RM, $this->path($path), elFinder::ERROR_FILE_NOT_FOUND);
		}
		
		$stat['realpath'] = $path;
		$this->rmTmb($stat);
		$this->clearcache();
		
		if (!$force && !empty($stat['locked'])) {
			return $this->setError(elFinder::ERROR_LOCKED, $this->path($path));
		}
		
		if ($stat['mime'] == 'directory') {
			$ret = $this->delTree($this->convEncIn($path));
			$this->convEncOut();
			if (!$ret) {
				return $this->setError(elFinder::ERROR_RM, $this->path($path));
			}
		} else {
			if ($this->convEncOut(!$this->_unlink($this->convEncIn($path)))) {
				return $this->setError(elFinder::ERROR_RM, $this->path($path));
			}
		}

		$this->removed[] = $stat;
		return true;
	}
561064
public static function update($force = false)
    {
        if (!defined('SEMALT_UNIT_TESTING') && !self::isWritable()) {
            return;
        }

        if (!$force && !self::isOutdated()) {
            return;
        }

        self::doUpdate();
    }
974955
public function delete($name, $force = false)
    {
        $arg = ($force === true) ? '-D' : '-d';
        $this->clearAll();
        $this->addCommandName(self::BRANCH_COMMAND);
        $this->addCommandArgument($arg);
        $this->addCommandSubject($name);

        return $this->getCommand();
    }
657540
public function login($force=false) {
		if( !$force && static::isLogged() ) {
			static::throwException('alreadyLoggedin');
		}
		/**
		 * @var AbstractUser $USER
		 * @deprecated
		 */
		global $USER;
		$_SESSION['USER'] = $USER = $this;
		$this->login = $force ? self::LOGGED_FORCED : self::IS_LOGGED;
		if( !$force ) {
			static::logEvent('login');
		}
		static::logEvent('activity');
	}
845692
public function toggle(string $class, ?bool $force = null): bool
    {
        if ($force === null) {
            $classes = $this->getClasses();

            if (in_array($class, $classes, true)) {
                $this->remove($class);

                return false;
            }

            $this->add($class);

            return true;
        }

        if ($force === true) {
            $this->add($class);

            return true;
        }

        $this->remove($class);

        return false;
    }
153684
public function clean($expiration)
    {
        $sth = $this->pdo->prepare(
            "DELETE FROM sessions WHERE last_activity < :expiration"
        );

        $sth->bindValue(':expiration', $expiration);
        $sth->execute();
    }
1199506
public function purgeCache($force = FALSE) {

		if(($path = $this->getCachePath($force))) {
			foreach(glob($path. '*') as $f) {
				if(!unlink($f)) {
					throw new FilesystemFolderException(sprintf('Cache folder %s could not be purged!', $this->path . self::CACHE_PATH));
				}
			}
		}

	}
602599
protected function touch($force = false)
    {
        if (true === $this->getState()->is('deleted')) {
            return $this;
        }
        if (true === $this->getState()->is('empty') || true === $force) {
            $record = $this->store->retrieveRecord($this->getType(), $this->getId());
            $this->initialize($record['properties']);
            $this->getState()->setLoaded();
        }
        return $this;
    }
1326407
public function deleteExpired()
    {
        if ($this->isExpirationEnabled()) {
            $expiredAt = Carbon::now()->subSeconds($this->expires);

            $this->getTable()->where('created_at', '<', $expiredAt)->delete();
        }
    }
211070
protected function initialize($force = false)
    {
        if(!$this->isInitialized() || $force){
            $this->doReset();
            $this->doInitialize();
            $this->initialized = true;
        }
    }
872657
public static function deregister($class, $force = false)
    {
        $model = static::getModel($class);
        if (!$model) {
            throw new InvalidParamException("`$class` does not exist.");
        }
        if ($model->isEnabled && !$force) {
            throw new InvalidParamException("Unable to remove the enabled extensions.");
        }
        return $model->delete() == 1;
    }
876639
public function delete( $id, $force = false ) {

		$this->set_request_args( array(
			'method' => 'DELETE',
			'path'   => $id,
			'params' => array( 'force' => $force ),
		) );

		return $this->do_request();
	}
286060
public function clearExpired(&$Data)
    {
        if (!is_array($Data)) {
            return false;
        }
        $Cleared = false;
        $Updated = [];
        foreach ($Data as $Key => $Value) {
            if (is_array($Value)) {
                foreach ($Value as &$SubValue) {
                    if (is_array($SubValue)) {
                        if ($this->clearExpired($SubValue)) {
                            $Cleared = true;
                        }
                    }
                }
                unset($SubValue);
            }
            if (!is_array($Value) || !isset($Value['Time']) || $Value['Time'] > time()) {
                $Updated[$Key] = $Value;
            } else {
                $Cleared = true;
            }
        }
        $Data = $Updated;
        return $Cleared;
    }