If a config file name is specified, flushes cached config values
 for specified config file. Otherwise, flushes all cached config data.
 The latter should be avoided in production environments, if possible.
11765
def flush_cache(name=nil)
      if name
        name = name.to_s
        self.cache_hash[name] &&= nil
      else
        logger.warn "RConfig: Flushing config data cache."
        self.suffixes        = {}
        self.cache           = {}
        self.cache_files     = {}
        self.cache_hash      = {}
        self.last_auto_check = {}
        self
      end
    end
1293493
public function clean($params = [])
    {
        if ( ! empty($this->config['primary_config_file']))
        {
            $default_settings = Arr::dot(Config::get($this->config['primary_config_file']));
            $saved_settings   = Arr::dot($this->getAll($cache = false));

            if (array_key_exists('flush', $params) && $params['flush'] == true)
            {
                $this->flush();

                $saved_settings = [];
            }
            else
            {
                foreach ($saved_settings as $key => $value)
                {
                    if ( ! array_key_exists($key, $default_settings))
                    {
                        if ( ! key_represents_an_array($key, $default_settings))
                        {
                            $this->forget($key);
                        }
                    }
                }
            }


            // update with new settings
            foreach ($default_settings as $key => $value)
            {
                if ( ! preg_key_exists($key, $saved_settings))
                {
                    // check if key does not represents an array and exists in saved settings
                    if ( ! key_represents_an_array($key, $saved_settings))
                    {
                        $this->set($key, $value);
                    }
                }
            }
        }
    }
46492
def flush(self, file=str()):
        
        if file:
            Path(file).write_bytes(self._cache)
        else:
            self.path.write_bytes(self._cache)
325980
public function flush()
    {
        // this may take a while, but they shouldn't be flushing in production
        $cache_keys = $this->redis->keys(/* prefixed with cache: */ '*');

        foreach ($cache_keys as $key) {
            $this->redis->del($key);
        }

        unset($cache_keys);

        return true;
    }
87542
def reload_on_change(name)
      logger.debug "reload_on_change(#{name.inspect}), reload_disabled=#{self.reload_disabled?}"
      if changed = config_changed?(name) && reload?
        if self.cache_hash[name]
          flush_cache(name)  # flush cached config values.
          fire_on_load(name) # force on_load triggers.
        end
      end
      changed
    end
754592
def set_config_value(self, name, value):
        
        if value is True:
            value = "True"
        elif value is False:
            if name in self.config_dict:
                del self.config_dict[name]
                self.config_changed = True
            return
        if name not in self.config_dict or self.config_dict[name] != value:
            self.config_changed = True
            self.config_dict[name] = value
1070889
public function flush()
    {
        if (false === (bool)$this->configuration->get('clearCacheForAllDomains')) {
            $this->flushByTag('sfc_domain_' . \str_replace('.', '_', GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY')));

            return;
        }

        $this->logger->debug('SFC Flush');

        if ($this->isBoostMode()) {
            $identifiers = GeneralUtility::makeInstance(CacheRepository::class)->findAllIdentifiers();
            $this->getQueue()->addIdentifiers($identifiers);

            return;
        }

        $absoluteCacheDir = GeneralUtility::getFileAbsFileName(self::CACHE_DIRECTORY);
        $removeService = GeneralUtility::makeInstance(RemoveService::class);
        $removeService->softRemoveDir($absoluteCacheDir . 'https/');
        $removeService->softRemoveDir($absoluteCacheDir . 'http/');
        parent::flush();
        $removeService->removeDirs();
    }
1193303
public function cleanAction()
    {
        $this->putText("Cleaning cache...");

        $di = DI::getDefault();

        if ($di->has('config')) {
            $config = $di->get('config');

            if (!empty($config->application->view->cacheDir)) {
                $this->removeFilesFromDir($config->application->view->cacheDir);
            }

            $this->putSuccess("Done.");
        }
    }
1039237
public function flushAll()
    {
        if (null !== $this->cache) {
            foreach ($this->config as $config) {
                if (array_key_exists('cacheKey', $config)) {
                    $this->app[$this->cache]->delete($config['cacheKey']);
                }
            }
        }

        $this->config = [];
    }
15942
def rebuild_config_cache(self, config_filepath):
        
        self.validate_config_file(config_filepath)
        config_data = None
        try:
            with open(config_filepath, 'r') as f:
                config_data = yaml.load(f)
            items = list(iteritems(config_data))

        except AttributeError:
            items = list(config_data)

        self.config_file_contents = OrderedDict(sorted(items, key=lambda x: x[0], reverse=True))
        self.config_filepath = config_filepath
229015
function (config) {
    config = config || {};
    Appender.call(this, config);

    /**
     * Log file name, initialized from the configuration. Folders up to the
     * file must exist beforehand.
     */
    this.fileName = config.fileName;

    /**
     * Append log events to the end of the file when true, clear the file
     * before writing the first log event otherwise.
     */
    this.appendToFile = (typeof config.append !== 'undefined') ?
      !!config.append :
      true;

    /**
     * True to log strings instead of objects
     */
    this.appendStrings = (typeof config.appendStrings !== 'undefined') ?
      config.appendStrings :
      true;

    /**
     * The file stream, initialized by the "start" function
     */
    this.stream = null;
  }
468694
def _isConfigFile(self,filename):
        """"""
        ext=os.path.splitext(filename)[1].lower()
        if filename in self.FB_CONFIG_FILES:
            return True
        elif ext in self.FB_META_EXTENSIONS:
            return True
        return False
1196686
def config_changed?(name)
      logger.debug "config_changed?(#{name.inspect})"
      name = name.to_s
      !(self.cache_files[name] === get_config_files(name))
    end
580739
def read_config_file(filename)
      contents = ""
      File.open(filename, "r") { |f| contents = f.read() } if File.exists?(filename)
      contents
    end
724450
public static function flush($name = null) {
		$_this = static::getInstance();

		if (isset($_this->_adapterConfig[$name])) {
			unset($_this->_adapterConfig[$name]);

			return true;
		}

		return false;
	}
246535
public void setHandlerConfig(Map config)
   {
      configMap.clear();
      if (config != null)
         configMap.putAll(config);
   }
427627
def delete_cached_files(self, prefixes=[], suffixes=[]):
        
        for filename in listdir(self.cache_directory_path):
            delete = (
                any([filename.endswith(ext) for ext in suffixes]) or
                any([filename.startswith(pre) for pre in prefixes]))
            if delete:
                path = join(self.cache_directory_path, filename)
                logger.info("Deleting %s", path)
                remove(path)