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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | registry_theme_function_rename-287877.patch | 5.79 KB | dmitrig01 |
Comments
Comment #1
dmitrig01 commentedWith a patch too!
Comment #2
chx commentedThis is a fine and logical step ahead.
Comment #3
dries commentedI'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!
Comment #4
dmitrig01 commentedhttp://drupal.org/node/224333#rebuild-functions
Comment #5
dmitrig01 commentedComment #6
webchickWait. 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.
Comment #7
webchickCorrection. I recommend:
s/drupal_theme_rebuild/drupal_rebuild_theme_registry/g;
s/registry_rebuild/drupal_rebuild_code_registry/g;
...or something similar.
Comment #8
Tor Arne Thune commentedStill a valid issue: http://api.drupal.org/api/search/7/rebuild
Comment #9
sunReverting to fixed. Original commit was correct. [subject]_[verb]() is the common and preferred naming pattern for procedural functions.