Retrieves the FieldInfo object for the current request.
FieldInfo An instance of the FieldInfo class.
function _field_info_field_cache() {
// Use the advanced drupal_static() pattern, since this is called very often.
static $drupal_static_fast;
if (!isset($drupal_static_fast)) {
$drupal_static_fast['field_info_field_cache'] =& drupal_static(__FUNCTION__);
}
$field_info =& $drupal_static_fast['field_info_field_cache'];
if (!isset($field_info)) {
// @todo The registry should save the need for an explicit include, but not
// a couple upgrade tests (DisabledNodeTypeTestCase,
// FilterFormatUpgradePathTestCase...) break in a strange way without it.
include_once dirname(__FILE__) . '/field.info.class.inc';
$field_info = new FieldInfo();
}
return $field_info;
}