aboutsummaryrefslogtreecommitdiff
path: root/mod/developers/classes/ElggLogCache.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-07-06 03:55:10 -0700
committerCash Costello <cash.costello@gmail.com>2011-07-06 03:55:10 -0700
commite4ad206bfd288463a37cfd4f86e6f343e3a35f77 (patch)
tree6a7c84a815467fc34d7ce266b682f7816427f50d /mod/developers/classes/ElggLogCache.php
parentd15c4bdf3388b7eca709bd81c522ac1ebf087f0a (diff)
parentb3382a41496bee4b66bc69421b9612bedfb77913 (diff)
downloadelgg-e4ad206bfd288463a37cfd4f86e6f343e3a35f77.tar.gz
elgg-e4ad206bfd288463a37cfd4f86e6f343e3a35f77.tar.bz2
Merge pull request #54 from cash/dev-tools
Fixes #3564 Adds the inspection tool and logging to the web page
Diffstat (limited to 'mod/developers/classes/ElggLogCache.php')
-rw-r--r--mod/developers/classes/ElggLogCache.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/mod/developers/classes/ElggLogCache.php b/mod/developers/classes/ElggLogCache.php
new file mode 100644
index 000000000..5bd4bce28
--- /dev/null
+++ b/mod/developers/classes/ElggLogCache.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Cache logging information for later display
+ *
+ */
+
+class ElggLogCache {
+ protected $cache;
+
+ public function __construct() {
+ $this->cache = array();
+ }
+
+ /**
+ * Insert into cache
+ *
+ * @param mixed $data The log data to cache
+ */
+ public function insert($data) {
+ $this->cache[] = $data;
+ }
+
+ /**
+ * Insert into cache from plugin hook
+ *
+ * @param string $hook
+ * @param string $type
+ * @param bool $result
+ * @param array $params Must have the data at $params['msg']
+ */
+ public function insertDump($hook, $type, $result, $params) {
+ $this->insert($params['msg']);
+ return false;
+ }
+
+ /**
+ * Get the cache
+ *
+ * @return array
+ */
+ public function get() {
+ return $this->cache;
+ }
+}