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)

Comments

JamesAn’s picture

Status: Active » Needs review
StatusFileSize
new4.4 KB
JamesAn’s picture

StatusFileSize
new4.42 KB

Bah. 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!

pwolanin’s picture

Per 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. :

&drupal_static(__FUNCTION__ . ':second_var');
JamesAn’s picture

StatusFileSize
new4.42 KB

Gotcha. Here's attempt #3!

dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.