function _expire_get_expiration_handler in Cache Expiration 7.2
Return class object that should handle expiration.
Parameters
$type: Type that expiration is called for. Example: 'node', 'user', 'votingapi', etc.
Return value
mixed
3 calls to _expire_get_expiration_handler()
- ExpireVotingapi::expire in includes/
expire.votingapi.inc - Executes expiration actions for user.
- expire_execute_expiration in ./
expire.module - Execute expiration method for object.
- _drush_expire_entity in ./
expire.drush.inc - Internal function for expiration of all entities.
File
- ./
expire.module, line 309 - Provides logic for page cache expiration.
Code
function _expire_get_expiration_handler($type) {
$cache_objects =& drupal_static('expire_cache_objects', array());
if (!isset($cache_objects[$type])) {
// Make class names more readable.
$bits = explode('_', $type);
$class_bits = array();
foreach ($bits as $bit) {
$class_bits[] = drupal_ucfirst($bit);
}
$class = variable_get('expire_handler_' . $type, 'Expire' . implode('', $class_bits));
if (class_exists($class)) {
$cache_objects[$type] = new $class();
}
else {
$cache_objects[$type] = FALSE;
trigger_error("Unable to find expiration handler class {$class} for type {$type}.", E_USER_ERROR);
}
}
return $cache_objects[$type];
}