aboutsummaryrefslogtreecommitdiff
path: root/mod/developers/classes/ElggLogCache.php
blob: 19df598d7e8115d75d11b7fef0d9d5f54deb96d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?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']);
	}

	/**
	 * Get the cache
	 *
	 * @return array
	 */
	public function get() {
		return $this->cache;
	}
}