follow-up to: #254491: Standardize static caching
see last patch examples: http://drupal.org/node/254491#comment-1430180 and also: http://drupal.org/node/224333#static_variable_api
Apply this conversion pattern to includes/path.inc, registry.inc, and session.inc to convert all static variables there. Pay close attention to any place a reset parameter is provided and add a call to drupal_static_reset() where appropriate (e.g. in any calling function that uses the reset parameter)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | jamesan_422374-3.patch | 4.42 KB | JamesAn |
| #2 | jamesan_422374-2.patch | 4.42 KB | JamesAn |
| #1 | jamesan_422374.patch | 4.4 KB | JamesAn |
Comments
Comment #1
JamesAn commentedComment #2
JamesAn commentedBah. I misunderstood; I was wondering why the first parameter was always __FUNCTION__ and then realized, that was just to ensure the parameter was unique. So functions with multiple static vars need to rename subsequent strings sent into drupal_static. I gets it now!
Comment #3
pwolanin commentedPer dPer discussion w/ catch - if you have a variable name more complex than just __FUNCTION__, use a ':' to separate the suffix (this will avoid colliding with any other valid function name). e.g. :
Comment #4
JamesAn commentedGotcha. Here's attempt #3!
Comment #5
dries commentedCommitted to CVS HEAD. Thanks!