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


PHP Localization::clearCache方法代码示例

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


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

示例1: upgrade

 /**
  * Upgrades a package's database and refreshes all blocks.
  */
 public function upgrade()
 {
     $this->upgradeDatabase();
     // now we refresh all blocks
     $manager = new Manager($this->app);
     $items = $manager->driver('block_type')->getItems($this->getPackageEntity());
     foreach ($items as $item) {
         $item->refresh();
     }
     \Localization::clearCache();
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:14,代码来源:Package.php

示例2: foreach

 foreach ($local as $_pkg) {
     $updates++;
     $localHandles[] = $_pkg->getPackageHandle();
 }
 foreach ($remote as $_pkg) {
     if (!in_array($_pkg->getPackageHandle(), $localHandles)) {
         $updates++;
     }
 }
 if ($tp->canInstallPackages()) {
     foreach (Package::getAvailablePackages() as $_pkg) {
         $_pkg->setupPackageLocalization();
         $pkgAvailableArray[] = $_pkg;
     }
     if (count($pkgAvailableArray) > 0) {
         Localization::clearCache();
     }
 }
 $thisURL = $view->url('/dashboard/extend/install');
 $availableArray = $pkgAvailableArray;
 usort($availableArray, function ($a, $b) {
     return strcasecmp($a->getPackageName(), $b->getPackageName());
 });
 /* Load featured add-ons from the marketplace.
  */
 $db = Loader::db();
 if (is_object($mi) && $mi->isConnected() && Config::get('concrete.marketplace.enabled') && $tp->canInstallPackages()) {
     $purchasedBlocksSource = Marketplace::getAvailableMarketplaceItems();
 } else {
     $purchasedBlocksSource = array();
 }
开发者ID:ryanneilstroud,项目名称:xsericon,代码行数:31,代码来源:install.php

示例3: export_translations

 public function export_translations($localeCode)
 {
     $result = new EditResponse();
     try {
         if (!Core::make('token')->validate('export_translations')) {
             throw new \Exception(Core::make('token')->getErrorMessage());
         }
         $section = Section::getByLocale($localeCode);
         if (is_object($section) && !$section->isError()) {
             if ($section->getLocale() == Config::get('concrete.multilingual.default_source_locale')) {
                 $section = null;
             }
         } else {
             $section = null;
         }
         if (!isset($section)) {
             throw new \Exception(t('Invalid language identifier'));
         }
         $translations = $section->getSectionInterfaceTranslations();
         $extractor = Core::make('multilingual/extractor');
         $extractor->mergeTranslationsWithSectionFile($section, $translations);
         $extractor->saveSectionTranslationsToFile($section, $translations);
         \Localization::clearCache();
         $result->setAdditionalDataAttribute('newToken', Core::make('token')->generate('export_translations'));
         $result->message = t('The translations have been exported to file and will be used by the website.');
     } catch (\Exception $x) {
         $result->setError($x);
     }
     $result->outputJSON();
 }
开发者ID:digideskio,项目名称:concrete5,代码行数:30,代码来源:translate_interface.php


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