function drupal_autoload_trait in Drupal 7
Confirms that a trait is available.
This function is rarely called directly. Instead, it is registered as an spl_autoload() handler, and PHP calls it for us when necessary.
Parameters
string $trait: The name of the trait to check or load.
Return value
bool TRUE if the trait is currently available, FALSE otherwise.
Related topics
1 call to drupal_autoload_trait()
- BootstrapAutoloadTestCase::testAutoloadCase in modules/
simpletest/ tests/ bootstrap.test - Tests that autoloader name matching is not case sensitive.
1 string reference to 'drupal_autoload_trait'
- _drupal_bootstrap_database in includes/
bootstrap.inc - Initializes the database system and registers autoload functions.
File
- includes/
bootstrap.inc, line 3437 - Functions that need to be loaded on every Drupal request.
Code
function drupal_autoload_trait($trait) {
return _registry_check_code('trait', $trait);
}