We always put actions last in functions. So that would transform the functions into drupal_code_registry_rebuild and drupal_theme_registry_rebuild. In code we don't refer to the code registry as the "code registry", just the "registry". We can also refer to the theme registry as theme, thus transforming them into drupal_registry_rebuild and drupal_theme_rebuild. In menu_rebuild we do not use drupal_, so we shouldn't in registry and theme either. Not using it in theme would create a namespace conflict (what if someone names their theme function "rebuild"?), but it's fine with registry.

Comments

dmitrig01’s picture

With a patch too!

chx’s picture

Status: Needs review » Reviewed & tested by the community

This is a fine and logical step ahead.

dries’s picture

Status: Reviewed & tested by the community » Needs work

I've committed this patch to CVS HEAD. I'm not marking this 'fixed' because we'll want to update the module upgrade documentation in the handbook. Please mark this fixed once this change is documented for module developers. Thanks!

dmitrig01’s picture

dmitrig01’s picture

Status: Needs work » Fixed
webchick’s picture

Status: Fixed » Active

We always put actions last in functions.

Wait. We do? Since when?

taxonomy_get_tree/vocabulary/parents/children...
form_set_cache/value/...
node_access_acquire_grants/node_access_write_grants
db_rewrite_sql

In fact, I can't seem to find one instance of having {scope}_{subject}_{verb} but I can find many, many instances of {scope}_{verb}_{subject}.

Our "mother language" is wildly inconsistent regarding which it puts first, but the PEAR coding standards http://pear.php.net/manual/en/standards.naming.php recommend the same {scope}_{verb}_{subject} pattern:

XML_RPC_serializeData()
getData()
buildSomeWidget()

I recommend rolling this back.

webchick’s picture

Correction. I recommend:

s/drupal_theme_rebuild/drupal_rebuild_theme_registry/g;
s/registry_rebuild/drupal_rebuild_code_registry/g;

...or something similar.

Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev
sun’s picture

Version: 8.x-dev » 7.x-dev
Status: Active » Closed (fixed)

Reverting to fixed. Original commit was correct. [subject]_[verb]() is the common and preferred naming pattern for procedural functions.