What's the point of calling this function? Its return value is never check, so it seems to be no-op aside from some side effect inside drupal_function_exists().

Comments

dropcube’s picture

Status: Active » Closed (works as designed)

From the docs of drupal_function_exists($function): If the function is not available, it tries to load the file where the function lives.

This is the point of calling drupal_function_exists, load the file where the callback function is.

mattyoung’s picture

Status: Closed (works as designed) » Active

Yes, thanks for the info. I just read up on this and the registry and realize what's going on.

I think the function name is wrong because of its side effect is its real purpose.

It should be called drupal_load_function(), something like that so just reading the code we understand what's going on.

Also I wish the name registry is more explicit. Registry is such a generic term. Makes looking up things about it very difficult.

It should be something like code_registry like the theme_registry.

I'm flipping this back to 'active' so maybe my suggestion can get some consideration.

berdir’s picture