constructor

@param string $cache_dir directory for cache-files
@param integer $cache_lifetime lifetime for caching-files in seconds or 0 for unlimited
@access public
345872
function nusoap_wsdlcache($cache_dir='.', $cache_lifetime=0) {
		$this->fplock = array();
		$this->cache_dir = $cache_dir != '' ? $cache_dir : '.';
		$this->cache_lifetime = $cache_lifetime;
	}
475257
public function warmUp($cacheDir)
    {
        $baseDir = $this->annotationDir.DIRECTORY_SEPARATOR.'Sidus'.DIRECTORY_SEPARATOR.'EAV'.DIRECTORY_SEPARATOR;
        if (!@mkdir($baseDir, 0777, true) && !is_dir($baseDir)) {
            throw new \RuntimeException("Unable to create annotations directory: {$baseDir}");
        }

        foreach ($this->familyRegistry->getFamilies() as $family) {
            $content = $this->getFileHeader($family);

            foreach ($family->getAttributes() as $attribute) {
                $content .= $this->getAttributeMethods($family, $attribute);
            }

            $content .= "}\n";

            $this->writeFile($baseDir.$family->getCode().'.php', $content);
        }
    }
200518
function use_cache ( $key = '' )
		{
			if (empty($_POST))
			{
				$this->cache_filename  =  $this->cache_dir . 'cache_' . md5($_SERVER['REQUEST_URI'] . serialize($key)) . '.ser';
				if (($_SERVER['HTTP_CACHE_CONTROL'] != 'no-cache')  &&  ($_SERVER['HTTP_PRAGMA'] != 'no-cache')  &&  @is_file($this->cache_filename))
				{
					if ((time() - filemtime($this->cache_filename)) < $this->cache_lifetime)
					{
						readfile($this->cache_filename);
						exit;
					}
				}
				ob_start( array( &$this, 'cache_callback' ) );
			}
		}
7463
public function saveCache(string $cache_name = null)
    {
        $cache_dir = $this->cache_path;
        $cnt = 0;
        foreach ($this->repository as $name => &$cache)
        {
            if ($cache_name !== null && $name !== $cache_name)
                continue;

            if (empty($cache['_changed']))
                continue;
            
            ++$cnt;
            unset($cache['_changed']);
            $cache_file = $cache_dir . '/' . $name . '.cache';
            file_put_contents($cache_file, serialize($cache));
            Hook::execute('Wedeto.IO.FileCreated', ['path' => $cache_file]);
        }
        return $cnt;
    }
265302
public function file_cache($key,$value=null,$expire=70,$prefix=''){
        if (empty($key)) return false;
        $option = array(
            'type'=>'File',
            'prefix'=>$prefix,
            'path'=>CACHE_PATH,
        );
        $expire = empty($expire)?0:$expire;
        $cache = \think\Cache::connect($option);
        if ($value){
            return $cache->set($key,$value,$expire);
        }else{
            return $cache->rm($key);
        }
    }
1094689
public static function setDirectoryCache($directory, $fileExtension = DirectoryCache::DEFAULT_EXTENSION)
    {
        self::$cacheImplementation = new DirectoryCache($directory, $fileExtension);
        self::$hasBeenCleared      = false;
    }
1101691
def cache_dir(self, path, saltenv='base', include_empty=False,
                  include_pat=None, exclude_pat=None, cachedir=None):
        '''
        
        '''
        ret = []

        path = self._check_proto(salt.utils.data.decode(path))
        # We want to make sure files start with this *directory*, use
        # '/' explicitly because the master (that's generating the
        # list of files) only runs on POSIX
        if not path.endswith('/'):
            path = path + '/'

        log.info(
            'Caching directory \'%s\' for environment \'%s\'', path, saltenv
        )
        # go through the list of all files finding ones that are in
        # the target directory and caching them
        for fn_ in self.file_list(saltenv):
            fn_ = salt.utils.data.decode(fn_)
            if fn_.strip() and fn_.startswith(path):
                if salt.utils.stringutils.check_include_exclude(
                        fn_, include_pat, exclude_pat):
                    fn_ = self.cache_file(
                        salt.utils.url.create(fn_), saltenv, cachedir=cachedir)
                    if fn_:
                        ret.append(fn_)

        if include_empty:
            # Break up the path into a list containing the bottom-level
            # directory (the one being recursively copied) and the directories
            # preceding it
            # separated = string.rsplit(path, '/', 1)
            # if len(separated) != 2:
            #     # No slashes in path. (So all files in saltenv will be copied)
            #     prefix = ''
            # else:
            #     prefix = separated[0]
            cachedir = self.get_cachedir(cachedir)

            dest = salt.utils.path.join(cachedir, 'files', saltenv)
            for fn_ in self.file_list_emptydirs(saltenv):
                fn_ = salt.utils.data.decode(fn_)
                if fn_.startswith(path):
                    minion_dir = '{0}/{1}'.format(dest, fn_)
                    if not os.path.isdir(minion_dir):
                        os.makedirs(minion_dir)
                    ret.append(minion_dir)
        return ret
300601
function Cache(ttl, dir) {
    // This cache will live forever if ttl is null
  if (typeof ttl !== 'number') {
    ttl = null;
  }
  this.ttl = ttl;
  this.dir = dir;
}
323400
def _is_cache_dir_appropriate(cache_dir, cache_file):
    
    if os.path.exists(cache_dir):
        files = os.listdir(cache_dir)
        if cache_file in files:
            return True
        return not bool(files)
    return True
118744
public function setCacheDir($dir)
    {
        if (GenericValidator::validateDirName($dir)) {
            $this->cacheDir = $dir;
            FileSystemHelper::setUpDir($dir);
            return true;
        }
        return false;
    }
706927
protected function from_cache($cache_id)
	{
		$cache_id = md5($cache_id);
		if (array_key_exists($cache_id, $this->cached_paths))
		{
			return $this->cached_paths[$cache_id];
		}

		return false;
	}
889157
public function setCacheDir($dir)
    {
        $this->cacheDir = $dir;

        if (!is_dir($this->cacheDir)) {
            $this->createDir($this->cacheDir);
        }
    }
476639
public function warmUp($cacheDir)
    {
        $iterator = new ResourceFilterIterator(
            new RecursiveResourceIteratorIterator(
                new ResourceCollectionIterator(
                    $this->repo->get('/')->listChildren(),
                    ResourceCollectionIterator::CURRENT_AS_PATH
                ),
                RecursiveResourceIteratorIterator::SELF_FIRST
            ),
            $this->suffix,
            ResourceFilterIterator::FILTER_BY_NAME | ResourceFilterIterator::MATCH_SUFFIX
        );

        foreach ($iterator as $path) {
            try {
                $this->twig->loadTemplate($path);
            } catch (Twig_Error $e) {
                // Problem during compilation, stop
            }
        }
    }
1099323
public function generateAllCacheTree($cacheDir)
    {
        $this->cacheDir = $cacheDir;

        $tables = $this->database->listTables();

        foreach ($tables as $table) {
            // trigger loadDataContainer TL_HOOK
            System::getContainer()->get('huh.utils.dca')->loadDc($table);
        }
    }
477725
public function enableCache($lifetime = 600, CM_Cache_Abstract $cache = null) {
        if (!$cache) {
            $cache = CM_Cache_Shared::getInstance();
        }
        $this->_cache = $cache;
        $this->_cacheLifetime = (int) $lifetime;
    }
721669
private function init()
    {
        if (!is_dir($this->options['path'])) {
            if (mkdir($this->options['path'], 0755, true) && chmod($this->options['path'], 0755)) {
                return true;
            }
        }

        if (!is_writeable($this->options['path'])) {
            throw new CacheException('Cache Path: '.$this->options['path'].' is not writable');
        }

        return false;
    }
973751
def cache(cache_directory_path):
    """"""
    if not cache_directory_path:
        click.secho(dtool_config.utils.get_cache(
            CONFIG_PATH,
        ))
    else:
        click.secho(dtool_config.utils.set_cache(
            CONFIG_PATH,
            cache_directory_path
        ))