1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage Cache
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 /**
13 * Cache storage helper functions.
14 *
15 * @since 11.1
16 */
17 class JCacheStorageHelper
18 {
19 /**
20 * Cache data group
21 *
22 * @var string
23 * @since 11.1
24 */
25 public $group = '';
26
27 /**
28 * Cached item size
29 *
30 * @var string
31 * @since 11.1
32 */
33 public $size = 0;
34
35 /**
36 * Counter
37 *
38 * @var integer
39 * @since 11.1
40 */
41 public $count = 0;
42
43 /**
44 * Constructor
45 *
46 * @param string $group The cache data group
47 *
48 * @since 11.1
49 */
50 public function __construct($group)
51 {
52 $this->group = $group;
53 }
54
55 /**
56 * Increase cache items count.
57 *
58 * @param string $size Cached item size
59 *
60 * @return void
61 *
62 * @since 11.1
63 */
64 public function updateSize($size)
65 {
66 $this->size += $size;
67 $this->count++;
68 }
69 }
70