Warms up the cache.

@return string
197593
public function generate()
    {
        $businessEntities = $this->businessEntityHelper->getBusinessEntities();
        $skeletonDirs = $this->fileLocator->locate('@VictoireCoreBundle/CacheWarmer/skeleton/');
        $this->setSkeletonDirs($skeletonDirs);

        return $this->render('EntityProxy.php.twig', ['businessEntities' => $businessEntities]);
    }
1166419
public function getCache()
    {
        $data = apc_fetch($this->config['key_prefix'] . '.storage');
        $this->isCached = !empty($data);

        return $data;
    }
399949
public function getCached()
    {
        $cache = $this->cache->get('config');
        if ($cache === false) {
            $cache = $this->notCached;
            $this->cache->set('config', $cache);
        }
        return $cache;
    }
320477
protected function buildDataGetterCacheKey()
    {
        $keys = array();

        foreach ($this->columns as $column) {
            if ($column->isPrimaryKey()) {
                $keys[] = '$this->' . $column->getMethodNameGet() . '()';
            }
        }

        $key = "'" . $this->config->getCachePrefix() . "_data_' . " . implode(" . '_' . ", $keys);

        $this->vars['cache_key'] = '
    /**
     * Get cache key
     *
     * @return string
     */
    public function getCacheKey()
    {
        return ' . $key . ';
    }';
    }
1276230
public function warmUp($cacheDir)
    {
        if ($this->debug) {
            $collectedLogs = [];
            $previousHandler = \defined('PHPUNIT_COMPOSER_INSTALL');
            $previousHandler = $previousHandler ?: set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
                if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
                    return $previousHandler ? $previousHandler($type, $message, $file, $line) : false;
                }

                if (isset($collectedLogs[$message])) {
                    ++$collectedLogs[$message]['count'];

                    return;
                }

                $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
                // Clean the trace by removing first frames added by the error handler itself.
                for ($i = 0; isset($backtrace[$i]); ++$i) {
                    if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) {
                        $backtrace = \array_slice($backtrace, 1 + $i);
                        break;
                    }
                }

                $collectedLogs[$message] = [
                    'type' => $type,
                    'message' => $message,
                    'file' => $file,
                    'line' => $line,
                    'trace' => $backtrace,
                    'count' => 1,
                ];
            });
        }

        try {
            foreach ($this->warmers as $warmer) {
                if (!$this->optionalsEnabled && $warmer->isOptional()) {
                    continue;
                }
                if ($this->onlyOptionalsEnabled && !$warmer->isOptional()) {
                    continue;
                }

                $warmer->warmUp($cacheDir);
            }
        } finally {
            if ($this->debug && true !== $previousHandler) {
                restore_error_handler();

                if (file_exists($this->deprecationLogsFilepath)) {
                    $previousLogs = unserialize(file_get_contents($this->deprecationLogsFilepath));
                    $collectedLogs = array_merge($previousLogs, $collectedLogs);
                }

                file_put_contents($this->deprecationLogsFilepath, serialize(array_values($collectedLogs)));
            }
        }
    }
587363
public function load() {
        $data = $this->cache->get($this->name);

        if ($data !== false) {
            return unserialize($data);
        }
        return false;
    }
607709
public function refresh() {
        $outdated = [];
        foreach ($this->cache as $uri => $i) {
            try {
                $i->getMetadata(true);
            } catch (NotFound $e) {
                $outdated[] = $uri;
            } catch (Deleted $e) {
                $outdated[] = $uri;
            }
        }
        foreach ($outdated as $uri) {
            unset($this->cache[$uri]);
            foreach ($this->uri2id[$uri] as $id) {
                unset($this->id2uri[$id]);
            }
            unset($this->uri2id[$uri]);
        }
    }
946443
public function warmUp($cacheDir)
    {
        $filesystem = new Filesystem();
        $templates = [];

        foreach ($this->finder->findAllTemplates() as $template) {
            $templates[$template->getLogicalName()] = rtrim($filesystem->makePathRelative($this->locator->locate($template), $cacheDir), '/');
        }

        $templates = str_replace("' => '", "' => __DIR__.'/", var_export($templates, true));

        $this->writeCacheFile($cacheDir.'/templates.php', sprintf("<?php return %s;\n", $templates));
    }
1286337
public function cache()
    {
        $this->cache->remember($this->getCacheKey(), $this->getCacheLifetime(), function () {
            return $this->scan();
        });
    }
1354912
public function warmUp($cacheDir)
    {
        if ($this->container->has('admingenerator.generator.propel')) {
            $this->propelInit();
        }

        foreach ($this->finder->findAll() as $yaml) {
            try {
                $this->buildFromYaml($yaml);
            } catch (\Exception $e) {
                while ($e->getPrevious()) {
                    $e = $e->getPrevious();
                }
                echo ">> Skip warmup ".
                    $e->getMessage().
                    ".\nIn file ".
                    $e->getFile().
                    " on line ".
                    $e->getLine().
                    ".\nBacktrace:\n".
                    $e->getTraceAsString();
            }
        }
    }
167725
public function warm() {
    Timer::start('warm');

    $this->simpleWarmUp();
    $this->traverse();

    $this->logger->info('Cache warmer finish it\'s run in %sec sec.', ['%sec' => Timer::read('warm') / 1000]);
    Timer::stop('warm');
  }
700837
public function cache()
    {
        if (!$this->cache) {
            $this->cache = new Manager($this->configure('cache'), $this->taskworker);
        }
        return $this->cache;
    }
1147596
public function warmUp($cacheDir)
    {
        if (empty($this->activeTheme)) {
            return;
        }

        $locator = $this->locator->getLocator();

        /** @var TemplateReferenceInterface[] $allTemplates */
        $allTemplates = $this->finder->findAllTemplates();

        $templates = array();
        foreach ($this->activeTheme->getThemes() as $theme) {
            $this->activeTheme->setName($theme);
            foreach ($allTemplates as $template) {
                try {
                    $templates[$template->getLogicalName().'|'.$theme] = $locator->locate($template->getPath());
                } catch (\InvalidArgumentException $e) {
                }
            }
        }

        $this->writeCacheFile($cacheDir.'/templates.php', sprintf('<?php return %s;', var_export($templates, true)));
    }
393061
public function cache()
    {
        $keys = [
            'enable_caching',
            'cache_duration'
        ];
        $this->CacheSettings = $this->loadModel('Wasabi/Core.CacheSettings');
        $settings = $this->CacheSettings->getKeyValues(new CacheSetting(), $keys);
        if ($this->request->is('post') && !empty($this->request->data)) {
            $settings = $this->CacheSettings->newEntity($this->request->data);
            if (!$settings->errors()) {
                if ($this->CacheSettings->saveKeyValues($settings, $keys)) {
                    $this->Flash->success(__d('wasabi_core', 'The cache settings have been updated.'));
                    $this->redirect(['action' => 'cache']);
                    return;
                } else {
                    $this->Flash->error($this->dbErrorMessage);
                }
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }
        $this->set([
            'settings' => $settings,
            'cacheDurations' => $this->CacheSettings->cacheDurations
        ]);
    }
457668
public function getCachedResources()
    {
        $this->flush();

        return $this->cacheIsEnabled()
            ? IlluminateCache::get(config('health.cache.key'), collect())
            : collect();
    }
1000604
public function tempnam()
  {
    $sysTempDir = $this->_sysGetTempDir();
    do {
      $this->_tempnamCounter++;
      $name = $sysTempDir . "/" . $this->_tempnamCounter;
    } while (file_exists($name));

    return $name;
  }
1180148
public function getCache() {
        if (!file_exists($this->_fileName)) {
            $this->setCache();
        }

        return unserialize(($this->_uncompress(file_get_contents($this->_fileName))));
    }