清空表

@param string $sTable
@access public
@return array
544109
public function emptyTable(string $sTable) {
		if (!$sTable) {
			throw new TangoException('empty table name');
		}
		$sQuery = 'TRUNCATE TABLE `' . addslashes($sTable) . '`';
		return $this->exec($sQuery);
	}
1253217
public static function clearStatics()
	{
		self::$viewLevels     = array();
		self::$assetRules     = array();
		self::$userGroups     = array();
		self::$userGroupPaths = array();
		self::$groupsByUser   = array();
	}
690850
private function clearSigHandlers() {
        pcntl_signal(SIGTERM, SIG_DFL);
        pcntl_signal(SIGINT,  SIG_DFL);
        pcntl_signal(SIGQUIT, SIG_DFL);
        pcntl_signal(SIGUSR1, SIG_DFL);
        pcntl_signal(SIGUSR2, SIG_DFL);
        pcntl_signal(SIGCONT, SIG_DFL);
    }
626230
public function clear()
    {
        $cachePath   = $this->options['path'];
        $cachePrefix = $this->options['prefix'] ? $this->options['prefix'].DIRECTORY_SEPARATOR : '';
        $files       = (array) glob($cachePath.$cachePrefix.'*');

        foreach ($files as $file) {
            if (is_dir($file)) {
                $matches = glob($file.'/*.php');
                if (is_array($matches)) {
                    array_map('unlink', $matches);
                }
                rmdir($file);
            } else {
                $this->unlink($file);
            }
        }

        return true;
    }
1040949
public function removeAll()
    {
        $this->_validate();
        if (!$this->isLocked()) {
            $_SESSION[$this->publicStorage]['store'][$this->_namespaceName] = array();
            return true;
        }
        return false;
    }
325785
public function clean($value)
  {
    // Return null for empty strings.
    if ($value==='' || $value===null || $value===false)
    {
      return null;
    }

    // Replace all ambiguous characters.
    $tmp = $value;
    foreach ($this->ambiguities as $unambiguity => $ambiguities)
    {
      foreach ($ambiguities as $ambiguity)
      {
        // Note: str_replace works fine with multi byte characters like UTF-8.
        $tmp = str_replace($ambiguity, $unambiguity, $tmp);
      }
    }

    // Restore EOL for DOS users.
    if (PHP_EOL!="\n") $tmp = str_replace("\n", PHP_EOL, $tmp);

    // Return null for empty strings.
    if ($tmp==='') $tmp = null;

    return $tmp;
  }
913125
public function clean($value)
  {
    // First prune whitespace.
    $cleaner = PruneWhitespaceCleaner::get();
    $value   = $cleaner->clean($value);

    if ($value==='' || $value===null || $value===false)
    {
      return null;
    }

    $tidyConfig = ['clean'          => false,
                   'output-xhtml'   => true,
                   'show-body-only' => true,
                   'wrap'           => 100];

    $tidy = new \tidy;

    $tidy->parseString($value, $tidyConfig, self::getTidyEncoding());
    $tidy->cleanRepair();
    $value = trim(tidy_get_output($tidy));

    // In some cases Tidy returns an empty paragraph only.
    if (preg_match('/^(([\ \r\n\t])|(<p>)|(<\/p>)|(&nbsp;))*$/', $value)==1)
    {
      $value = null;
    }

    return $value;
  }
528060
public static function clear()
    {
        $path = root().'resources/controllers/*.php';

        $files = File::glob($path);
        //
        foreach ($files as $file) {
            File::delete($file);
        }
        //
        return true;
    }
1118485
public function removeAll()
    {
        $portableElements = $this->getAll();
        foreach ($portableElements as $identifier => $versions) {
            $this->removeAllVersions($identifier);
        }
    }
601999
public static function clear()
    {
        // load session config
        \Config::load('session', true);

        // prompt the user to confirm they want to clear the table.
        $iamsure = \Cli::prompt('Are you sure you want to clear the sessions table?', array('y','n'));

        // if they are sure, then let's drop it
        if ($iamsure === 'y')
        {
            \DBUtil::truncate_table(\Config::get('session.db.table'));
            return \Cli::color('Session database table successfully truncated.', 'green');
        }

        // if we made it to here, than that means the user said no.
        return \Cli::color('Session database table was not cleared.', 'red');
    }
1180610
public function repairTable(string $sTable) {
		if (!$sTable) {
			throw new TangoException('empty table name');
		}
		$sQuery = 'REPAIR TABLE `' . addslashes($sTable) . '`';
		return $this->exec($sQuery);
	}
781461
protected function clear() {
    foreach ($this->newObjects as $object) {
      unset($this->observedObjects[$object->getOID()->__toString()]);
    }
    $this->newObjects = [];

    foreach ($this->dirtyObjects as $object) {
      unset($this->observedObjects[$object->getOID()->__toString()]);
    }
    $this->dirtyObjects = [];

    foreach ($this->deletedObjects as $object) {
      unset($this->observedObjects[$object->getOID()->__toString()]);
    }
    $this->deletedObjects = [];

    foreach ($this->loadedObjects as $object) {
      unset($this->observedObjects[$object->getOID()->__toString()]);
    }
    $this->loadedObjects = [];

    $this->detachedObjects = [];
  }
189616
public static function cleanUpArray(array $parameters)
    {
        $cleanup = [];

        foreach ($parameters as $name => $value) {
            if (array_key_exists($name, self::CONFIRMATION_PROPERTIES)) {
                $cleanup[$name] = $value;
            }
        }

        return $cleanup;
    }
743536
public function clear()
    {
        foreach (array_keys($this->instances) as $key) {
            $this->instances[$key] = null;
            unset($this->instances[$key]);
        }

        $this->instances = [];
    }
1087262
public function describeFields($sTable = null)
    {
        $aFields     = parent::describeFields($sTable);
        $aMetaFields = parent::describeFields($this->tableMeta);
        unset($aMetaFields['user_id']);
        return array_merge($aFields, $aMetaFields);
    }
830044
protected function _getViewSelectMultilang($sTable)
    {
        $aFields = [];

        $oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
        $aTables = array_merge([$sTable], $oMetaData->getAllMultiTables($sTable));
        foreach ($aTables as $sTableKey => $sTableName) {
            $aTableFields = $oMetaData->getFields($sTableName);
            foreach ($aTableFields as $sCoreField => $sField) {
                if (!isset($aFields[$sCoreField])) {
                    $aFields[$sCoreField] = $sField;
                }
            }
        }

        return implode(',', $aFields);
    }
357889
public static function clearCache($remove = 'standard')
    {
        $locator = Grav::instance()['locator'];
        $output = [];
        $user_config = USER_DIR . 'config/system.yaml';

        switch ($remove) {
            case 'all':
                $remove_paths = self::$all_remove;
                break;
            case 'assets-only':
                $remove_paths = self::$assets_remove;
                break;
            case 'images-only':
                $remove_paths = self::$images_remove;
                break;
            case 'cache-only':
                $remove_paths = self::$cache_remove;
                break;
            case 'tmp-only':
                $remove_paths = self::$tmp_remove;
                break;
            case 'invalidate':
                $remove_paths = [];
                break;
            default:
                if (Grav::instance()['config']->get('system.cache.clear_images_by_default')) {
                    $remove_paths = self::$standard_remove;
                } else {
                    $remove_paths = self::$standard_remove_no_images;
                }

        }

        // Delete entries in the doctrine cache if required
        if (in_array($remove, ['all', 'standard'])) {
            $cache = Grav::instance()['cache'];
            $cache->driver->deleteAll();
        }

        // Clearing cache event to add paths to clear
        Grav::instance()->fireEvent('onBeforeCacheClear', new Event(['remove' => $remove, 'paths' => &$remove_paths]));

        foreach ($remove_paths as $stream) {

            // Convert stream to a real path
            try {
                $path = $locator->findResource($stream, true, true);
                if($path === false) continue;

                $anything = false;
                $files = glob($path . '/*');

                if (is_array($files)) {
                    foreach ($files as $file) {
                        if (is_link($file)) {
                            $output[] = '<yellow>Skipping symlink:  </yellow>' . $file;
                        } elseif (is_file($file)) {
                            if (@unlink($file)) {
                                $anything = true;
                            }
                        } elseif (is_dir($file)) {
                            if (Folder::delete($file)) {
                                $anything = true;
                            }
                        }
                    }
                }

                if ($anything) {
                    $output[] = '<red>Cleared:  </red>' . $path . '/*';
                }
            } catch (\Exception $e) {
                // stream not found or another error while deleting files.
                $output[] = '<red>ERROR: </red>' . $e->getMessage();
            }
        }

        $output[] = '';

        if (($remove === 'all' || $remove === 'standard') && file_exists($user_config)) {
            touch($user_config);

            $output[] = '<red>Touched: </red>' . $user_config;
            $output[] = '';
        }

        // Clear stat cache
        @clearstatcache();

        // Clear opcache
        if (function_exists('opcache_reset')) {
            @opcache_reset();
        }

        return $output;
    }