本文整理匯總了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;
}