Last active
December 24, 2015 13:49
-
-
Save mrded/6808165 to your computer and use it in GitHub Desktop.
Drupal: Static cache example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function static_cache($value = NULL) { | |
$_value = &drupal_static(__FUNCTION__, array()); | |
if (isset($value)) { | |
$_value = clone $value; | |
} | |
return $_value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment