本文整理汇总了PHP中cache_helper::get_definition_name方法的典型用法代码示例。如果您正苦于以下问题:PHP cache_helper::get_definition_name方法的具体用法?PHP cache_helper::get_definition_name怎么用?PHP cache_helper::get_definition_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cache_helper
的用法示例。
在下文中一共展示了cache_helper::get_definition_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_definition_summaries
/**
* Returns an array about the definitions. All the information a renderer needs.
* @return array
*/
public static function get_definition_summaries()
{
$instance = cache_config::instance();
$definitions = $instance->get_definitions();
$storenames = array();
foreach ($instance->get_all_stores() as $key => $store) {
if (!empty($store['default'])) {
$storenames[$key] = new lang_string('store_' . $key, 'cache');
}
}
$modemappings = array();
foreach ($instance->get_mode_mappings() as $mapping) {
$mode = $mapping['mode'];
if (!array_key_exists($mode, $modemappings)) {
$modemappings[$mode] = array();
}
if (array_key_exists($mapping['store'], $storenames)) {
$modemappings[$mode][] = $storenames[$mapping['store']];
} else {
$modemappings[$mode][] = $mapping['store'];
}
}
$definitionmappings = array();
foreach ($instance->get_definition_mappings() as $mapping) {
$definition = $mapping['definition'];
if (!array_key_exists($definition, $definitionmappings)) {
$definitionmappings[$definition] = array();
}
if (array_key_exists($mapping['store'], $storenames)) {
$definitionmappings[$definition][] = $storenames[$mapping['store']];
} else {
$definitionmappings[$definition][] = $mapping['store'];
}
}
$return = array();
foreach ($definitions as $id => $definition) {
$mappings = array();
if (array_key_exists($id, $definitionmappings)) {
$mappings = $definitionmappings[$id];
} else {
if (empty($definition['mappingsonly'])) {
$mappings = $modemappings[$definition['mode']];
}
}
$return[$id] = array('id' => $id, 'name' => cache_helper::get_definition_name($definition), 'mode' => $definition['mode'], 'component' => $definition['component'], 'area' => $definition['area'], 'mappings' => $mappings, 'sharingoptions' => self::get_definition_sharing_options($definition['sharingoptions'], false), 'selectedsharingoption' => self::get_definition_sharing_options($definition['selectedsharingoption'], true), 'userinputsharingkey' => $definition['userinputsharingkey']);
}
return $return;
}