This is a child task for #422380: Convert all core module to use new static caching API focusing on the filter module.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | drupal.filter-drupal-static.patch | 1014 bytes | sun |
| #16 | 480416-16.patch | 1.07 KB | JamesAn |
| #14 | 480416-11.patch | 1.93 KB | alonpeer |
| #11 | 480416-10.patch | 1.92 KB | JuliaKM |
| #9 | 480416-9.patch | 2.91 KB | JamesAn |
Comments
Comment #1
JamesAn commentedComment #2
catchNot sure why htmlcorrectory needs the statics at all there, but looks good anyway.
Comment #3
dries commentedShouldn't
+ $no_nesting = &drupal_static(__FUNCTION__, drupal_map_assoc(array('li', 'p')));be+ $no_nesting = &drupal_static(__FUNCTION__ . ":no_nesting", drupal_map_assoc(array('li', 'p')));for consistency?Comment #4
catchGenerally we've only been suffixing statics when we have to (i.e. http://api.drupal.org/api/function/taxonomy_get_tree/7 which was one of the first patches to go in), I can see arguments both ways though.
Comment #5
JamesAn commentedYes, the pattern seemed to not suffix the first static var.
Comment #6
catchThe reasoning for this is documented in the update docs: http://drupal.org/node/224333#static_variable_api
Comment #8
dave reidAdding novice tag.
Comment #9
JamesAn commentedRerolled.
Comment #11
JuliaKM commentedThis patch is re-rolled minus the changes to _filter_htmlcorrector, which has been rewritten to use PHP5 and no longer needs &drupal_static(__FUNCTION__).
Comment #14
alonpeer commentedPatch re-work.
Comment #16
JamesAn commentedRerolled. Some of the changes were already made so the patch is smaller.
Comment #17
sunThis conversion makes no sense, because this function is an internal preg_replace callback for _filter_url(). No module has a chance to intercept the operation anyway.
However, while being there and reverting the change, please change the if condition to use isset($length) instead of this awkward NULL test.
This review is powered by Dreditor.
Comment #18
sunComment #19
sun#562932: {filter_format}.cache is not saved will remove this static entirely.