Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295807

Deprecate drupal_static() and drupal_static_reset()

$
0
0

Problem/Motivation

drupal_static() should ideally be obsolete, but there are many procedural places in core that use them.

Other properly injected OO code needs to use drupal_static_reset() because of that, which leads to include-hell for tests.

Proposed resolution

Deprecate drupal_static() and drupal_static_reset(). Provide no replacement as using static variables is a bad design. Document that new code should not use drupal_static().

Remaining tasks

None.

User interface changes

None.

API changes

Both drupal_static() and drupal_static_reset() are now deprecated.


Viewing all articles
Browse latest Browse all 295807

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>