当前位置: 首页>>代码示例>>PHP>>正文


PHP KernelInterface::getCacheDir方法代码示例

本文整理汇总了PHP中Symfony\Component\HttpKernel\KernelInterface::getCacheDir方法的典型用法代码示例。如果您正苦于以下问题:PHP KernelInterface::getCacheDir方法的具体用法?PHP KernelInterface::getCacheDir怎么用?PHP KernelInterface::getCacheDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\HttpKernel\KernelInterface的用法示例。


在下文中一共展示了KernelInterface::getCacheDir方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: writeCache

 protected function writeCache(array $menu)
 {
     $file = $this->kernel->getCacheDir() . '/' . self::CACHE_FILENAME;
     $content = sprintf('<?php return %s;', var_export($menu, true));
     $fs = new Filesystem();
     $fs->dumpFile($file, $content);
 }
开发者ID:wellcommerce,项目名称:wellcommerce,代码行数:7,代码来源:AdminMenuProvider.php

示例2: getMetadataCache

 /**
  * @return mixed
  */
 protected function getMetadataCache()
 {
     if (empty($this->cache)) {
         if (is_file($cache = $this->kernel->getCacheDir() . '/' . self::CACHE_FILENAME)) {
             $this->cache = (require $cache);
         }
     }
     return $this->cache;
 }
开发者ID:WellCommerce,项目名称:ApiBundle,代码行数:12,代码来源:SerializationMetadataLoader.php

示例3: getConfigurations

 /**
  * @return array
  */
 public function getConfigurations()
 {
     if ($this->configuration !== null) {
         return $this->configuration;
     }
     $cacheFilePath = sprintf('%s/%s', $this->kernel->getCacheDir(), self::CACHE_FILE_NAME);
     $configuration = json_decode($this->filesystem->readFile($cacheFilePath), true);
     $this->configuration = $configuration;
     return $configuration;
 }
开发者ID:enhavo,项目名称:enhavo,代码行数:13,代码来源:MetadataCollector.php

示例4: loadBundles

 /**
  * @return \Symfony\Component\HttpKernel\Bundle\BundleInterface
  */
 public function loadBundles()
 {
     $bundles = [];
     if (is_file($cache = $this->kernel->getCacheDir() . '/' . self::CACHE_FILENAME)) {
         $bundleClasses = (require $cache);
     } else {
         $bundleClasses = $this->getManagedBundleClasses();
     }
     foreach ($bundleClasses as $bundleClass) {
         $bundles[] = new $bundleClass();
     }
     return $bundles;
 }
开发者ID:wellcommerce,项目名称:wellcommerce,代码行数:16,代码来源:BundleLoader.php

示例5: resolveAndReturnBundleDependencies

 /**
  * Resolve all bundle dependencies and return them all in a single array.
  *
  * @param KernelInterface $kernel  Kernel
  * @param array           $bundles Bundles defined by instances or namespaces
  *
  * @return Bundle[]|string[] Bundle definitions
  */
 protected function resolveAndReturnBundleDependencies(KernelInterface $kernel, array $bundles)
 {
     $cacheFile = $kernel->getCacheDir() . '/kernelDependenciesStack.php';
     if (!is_dir($kernel->getCacheDir())) {
         mkdir($kernel->getCacheDir(), 0777, true);
     }
     if (file_exists($cacheFile)) {
         return include $cacheFile;
     }
     $bundleStack = $this->originalResolveAndReturnBundleDependencies($kernel, $bundles);
     $this->cacheBuiltBundleStack($bundleStack, $cacheFile);
     return $bundleStack;
 }
开发者ID:mmoreram,项目名称:symfony-bundle-dependencies,代码行数:21,代码来源:CachedBundleDependenciesResolver.php

示例6: __construct

 /**
  * Constructor
  *
  * @param KernelInterface $kernel
  */
 public function __construct(KernelInterface $kernel)
 {
     // register email address proxy class loader
     $loader = new UniversalClassLoader();
     $loader->registerNamespaces([self::ENTITY_PROXY_NAMESPACE => $kernel->getCacheDir() . DIRECTORY_SEPARATOR . self::CACHED_ENTITIES_DIR_NAME]);
     $loader->register();
 }
开发者ID:xamin123,项目名称:platform,代码行数:12,代码来源:OroEmailBundle.php

示例7: __construct

 /**
  * Constructor
  *
  * @param KernelInterface $kernel
  */
 public function __construct(KernelInterface $kernel)
 {
     // register logging hydrators class loader
     $loader = new ClassLoader();
     $loader->addPrefix('OroLoggingHydrator\\', $kernel->getCacheDir() . DIRECTORY_SEPARATOR . 'oro_entities');
     $loader->register();
 }
开发者ID:hugeval,项目名称:platform,代码行数:12,代码来源:OroEntityBundle.php

示例8: getCacheDir

 /**
  * @return string
  */
 private function getCacheDir()
 {
     $cacheDir = $this->kernel->getCacheDir() . '/' . 'faker';
     if (!is_dir($cacheDir)) {
         mkdir($cacheDir);
     }
     return $cacheDir;
 }
开发者ID:glavweb,项目名称:GlavwebRestBundle,代码行数:11,代码来源:FileFaker.php

示例9: getMetadataArray

 private function getMetadataArray()
 {
     if ($this->metadataArray === null) {
         $cacheFilePath = sprintf('%s/%s', $this->kernel->getCacheDir(), MetadataCollection::CACHE_FILE_NAME);
         $content = file_get_contents($cacheFilePath);
         $this->metadataArray = json_decode($content, true);
     }
     return $this->metadataArray;
 }
开发者ID:enhavo,项目名称:enhavo,代码行数:9,代码来源:MetadataCollection.php

示例10: clearDiCache

 private function clearDiCache()
 {
     $finder = new Finder();
     $finder->in($this->kernel->getCacheDir());
     $finder->name('*.php');
     $finder->name('*.php.meta');
     $filesystem = new Filesystem();
     $filesystem->remove($finder);
 }
开发者ID:symfony-cmf,项目名称:resource-rest-bundle,代码行数:9,代码来源:ResourceContext.php

示例11: getLastMappingValidateFilePath

 /**
  * @return string
  */
 protected function getLastMappingValidateFilePath()
 {
     return $this->kernel->getCacheDir() . DIRECTORY_SEPARATOR . 'dev_bundle_last_mapping_validate';
 }
开发者ID:steevanb,项目名称:dev-bundle,代码行数:7,代码来源:ValidateSchemaService.php

示例12: needsBuild

 /**
  * {@inheritDocs}
  */
 public function needsBuild()
 {
     return !file_exists($this->kernel->getCacheDir() . '/propel-classes/');
 }
开发者ID:jarves,项目名称:jarves,代码行数:7,代码来源:Propel.php

示例13: read

 /**
  * @return array
  */
 public function read()
 {
     $cacheScriptPath = $this->kernel->getCacheDir() . self::CACHE_SCRIPT_PATH;
     return require $cacheScriptPath;
 }
开发者ID:mb3rnard,项目名称:hateoas-bundle,代码行数:8,代码来源:RamlDocSymfonyCache.php

示例14: __construct

 public function __construct(KernelInterface $kernel)
 {
     $this->kernel = $kernel;
     $this->cacheDir = $kernel->getCacheDir();
     ExtendClassLoadingUtils::registerClassLoader($this->cacheDir);
 }
开发者ID:northdakota,项目名称:platform,代码行数:6,代码来源:OroEntityExtendBundle.php

示例15: getSettingArrayFromCache

 protected function getSettingArrayFromCache()
 {
     $cacheFilePath = sprintf('%s/%s', $this->kernel->getCacheDir(), self::CACHE_FILE_NAME);
     $settingArray = json_decode($this->fileSystem->readFile($cacheFilePath), $assoc = true);
     return array_filter($settingArray);
 }
开发者ID:enhavo,项目名称:enhavo,代码行数:6,代码来源:DatabaseProvider.php


注:本文中的Symfony\Component\HttpKernel\KernelInterface::getCacheDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。