當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConfigManager::clearCache方法代碼示例

本文整理匯總了PHP中Oro\Bundle\EntityConfigBundle\Config\ConfigManager::clearCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigManager::clearCache方法的具體用法?PHP ConfigManager::clearCache怎麽用?PHP ConfigManager::clearCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Oro\Bundle\EntityConfigBundle\Config\ConfigManager的用法示例。


在下文中一共展示了ConfigManager::clearCache方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processConfigs

 /**
  * @param array                $configs
  * @param LoggerInterface|null $logger
  * @param bool                 $dryRun Log modifications without apply them
  * @throws \Exception
  */
 public function processConfigs(array $configs, LoggerInterface $logger = null, $dryRun = false)
 {
     $this->logger = $logger ?: new NullLogger();
     try {
         if (!empty($configs)) {
             $this->appendConfigs = $this->getAndRemoveElement($configs, self::APPEND_CONFIGS, []);
             $renameConfigs = $this->getAndRemoveElement($configs, self::RENAME_CONFIGS, []);
             $this->filterConfigs($configs);
             $hasChanges = false;
             if (!empty($configs)) {
                 foreach ($configs as $className => $entityConfigs) {
                     $this->processEntityConfigs($className, $entityConfigs);
                 }
                 $hasChanges = true;
             }
             if ($this->renameFields($renameConfigs)) {
                 $hasChanges = true;
             }
             if ($hasChanges) {
                 if ($dryRun) {
                     $this->configManager->clear();
                 } else {
                     $this->configManager->flush();
                     $this->configManager->clearCache();
                 }
             }
         }
     } catch (\Exception $ex) {
         $this->logger = null;
         throw $ex;
     }
 }
開發者ID:startupz,項目名稱:platform-1,代碼行數:38,代碼來源:ExtendConfigProcessor.php

示例2: up

 /**
  * @inheritdoc
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->configManager->clearCache();
     $this->configManager->clearConfigurableCache();
     if ($schema instanceof ExtendSchema) {
         $queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
     }
 }
開發者ID:xamin123,項目名稱:platform,代碼行數:11,代碼來源:RefreshExtendCacheMigration.php

示例3: up

 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->configManager->clearCache();
     $this->configManager->clearConfigurableCache();
     if ($schema instanceof ExtendSchema) {
         $queries->addQuery(new RefreshExtendConfigMigrationQuery($this->commandExecutor, $this->dataStorageExtension->get('initial_entity_config_state', []), $this->initialEntityConfigStatePath));
         $queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
     }
 }
開發者ID:hugeval,項目名稱:platform,代碼行數:12,代碼來源:RefreshExtendCacheMigration.php

示例4: load

 /**
  * Load entity configs from annotations to a database
  *
  * @param bool                 $force  Force overwrite config's option values
  * @param callable|null        $filter function (ClassMetadataInfo[] $doctrineAllMetadata)
  * @param LoggerInterface|null $logger
  * @param bool                 $dryRun Log modifications without apply them
  * @throws \Exception
  */
 public function load($force = false, \Closure $filter = null, LoggerInterface $logger = null, $dryRun = false)
 {
     $this->logger = $logger ?: new NullLogger();
     try {
         /** @var ClassMetadataInfo[] $doctrineAllMetadata */
         $doctrineAllMetadata = $this->configManager->getEntityManager()->getMetadataFactory()->getAllMetadata();
         if (null !== $filter) {
             $doctrineAllMetadata = $filter($doctrineAllMetadata);
         }
         foreach ($doctrineAllMetadata as $metadata) {
             $this->loadEntityConfigs($metadata, $force);
         }
         if ($dryRun) {
             $this->configManager->clear();
         } else {
             $this->configManager->flush();
             $this->configManager->clearCache();
             $this->configManager->clearConfigurableCache();
         }
     } catch (\Exception $ex) {
         $this->logger = null;
         throw $ex;
     }
 }
開發者ID:xamin123,項目名稱:platform,代碼行數:33,代碼來源:ConfigLoader.php

示例5: testClearCacheAll

 public function testClearCacheAll()
 {
     $this->configCache->expects($this->once())->method('deleteAllConfigs');
     $this->configManager->clearCache();
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:5,代碼來源:ConfigManagerTest.php

示例6: clearCache

 /**
  * Removes configuration data for the given object (entity or field) from the cache.
  *
  * @param string      $className
  * @param string|null $fieldName
  */
 public function clearCache($className, $fieldName = null)
 {
     $this->configManager->clearCache($this->getId($className, $fieldName));
 }
開發者ID:ashutosh-srijan,項目名稱:findit_akeneo,代碼行數:10,代碼來源:ConfigProvider.php

示例7: warmUp

 /**
  * {@inheritdoc}
  */
 public function warmUp($cacheDir)
 {
     $this->configManager->clearCache();
     $this->configManager->clearConfigurableCache();
     $this->dumper->dump();
 }
開發者ID:northdakota,項目名稱:platform,代碼行數:9,代碼來源:EntityCacheWarmer.php


注:本文中的Oro\Bundle\EntityConfigBundle\Config\ConfigManager::clearCache方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。