diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-09-04 14:56:06 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-09-04 14:56:06 +0200 |
commit | 54d5d869ad2c525dd276f28a8409658a106d9e3f (patch) | |
tree | de619bb4824b61d41b0452a94fc850cc28b27e35 /application/helpers/filebin_helper.php | |
parent | 720808fc3884a415dc483b50796697a095d1b5b8 (diff) |
Generalize request_type() to static_storage()
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/helpers/filebin_helper.php')
-rw-r--r-- | application/helpers/filebin_helper.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php index 9b124506f..7ba68b839 100644 --- a/application/helpers/filebin_helper.php +++ b/application/helpers/filebin_helper.php @@ -341,15 +341,19 @@ function send_json_reply($array, $status = "success") $CI->output->set_output(json_encode($reply)); } -function request_type($set_type = null) +function static_storage($key, $value = null) { - static $type = null; + static $storage = array(); - if ($set_type !== null) { - $type = $set_type; + if ($value !== null) { + $storage[$key] = $value; } - return $type; + if (!isset($storage[$key])) { + $storage[$key] = null; + } + + return $storage[$key]; } # vim: set noet: |