本文整理汇总了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();
}
示例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();
}
示例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();
}