本文整理汇总了PHP中RepairAndClear::repairMetadataAPICache方法的典型用法代码示例。如果您正苦于以下问题:PHP RepairAndClear::repairMetadataAPICache方法的具体用法?PHP RepairAndClear::repairMetadataAPICache怎么用?PHP RepairAndClear::repairMetadataAPICache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RepairAndClear
的用法示例。
在下文中一共展示了RepairAndClear::repairMetadataAPICache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_DeleteField
public function action_DeleteField()
{
$field = get_widget($_REQUEST['type']);
$field->name = $_REQUEST['name'];
if (!isset($_REQUEST['view_package'])) {
if (!empty($_REQUEST['name']) && !empty($_REQUEST['view_module'])) {
$moduleName = $_REQUEST['view_module'];
// bug 51325 make sure we make this switch or delete will not work
if ($moduleName == 'Employees') {
$moduleName = 'Users';
}
$seed = BeanFactory::getBean($moduleName);
$df = new DynamicField($moduleName);
$df->setup($seed);
//Need to load the entire field_meta_data for some field types
$field = $df->getFieldWidget($moduleName, $field->name);
$field->delete($df);
$GLOBALS['mod_strings']['LBL_ALL_MODULES'] = 'all_modules';
$_REQUEST['execute_sql'] = true;
include_once 'modules/Administration/QuickRepairAndRebuild.php';
$repair = new RepairAndClear();
$repair->repairAndClearAll(array('rebuildExtensions', 'clearVardefs', 'clearTpls'), array($moduleName), true, false);
require_once 'modules/ModuleBuilder/Module/StudioModuleFactory.php';
$module = StudioModuleFactory::getStudioModule($moduleName);
}
} else {
$mb = new ModuleBuilder();
$module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
$field = $module->getField($field->name);
$field->delete($module);
$mb->save();
}
$module->removeFieldFromLayouts($field->name);
$this->view = 'modulefields';
if (isset($GLOBALS['current_language']) && isset($_REQUEST['label']) && isset($_REQUEST['labelValue']) && isset($_REQUEST['view_module'])) {
$this->DeleteLabel($GLOBALS['current_language'], $_REQUEST['label'], $_REQUEST['labelValue'], $_REQUEST['view_module']);
$this->metadataApiCacheCleared = true;
}
// Clear the metadata cache if it hasn't been done already
if (!$this->metadataApiCacheCleared && !empty($moduleName)) {
// This removes the labels associated with the field and rebuilds
// the api cache for the module
$repair->module_list = array($moduleName);
$repair->repairMetadataAPICache('labels');
}
}
示例2: removeCustomExtensions
function removeCustomExtensions()
{
$out = "";
$extDir = "custom/Extension/modules/{$this->module}";
if (is_dir($extDir)) {
rmdir_recursive($extDir);
require_once 'modules/Administration/QuickRepairAndRebuild.php';
$rac = new RepairAndClear();
$rac->repairAndClearAll(array('clearAll'), array($this->module), true, false);
$rac->rebuildExtensions();
// This allows the rebuilding of module only metadata
$rac->repairMetadataAPICache(false);
$out .= "Cleared extensions for {$this->module}<br/>";
}
return $out;
}