summaryrefslogtreecommitdiffstats
path: root/application/helpers
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-09-04 14:56:06 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-09-04 14:56:06 +0200
commit54d5d869ad2c525dd276f28a8409658a106d9e3f (patch)
treede619bb4824b61d41b0452a94fc850cc28b27e35 /application/helpers
parent720808fc3884a415dc483b50796697a095d1b5b8 (diff)
Generalize request_type() to static_storage()
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/helpers')
-rw-r--r--application/helpers/filebin_helper.php14
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: