PluginProbe
Polylang / 1.8
Polylang v1.8
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | include/cache.php +14 -16 2.71.8 View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2
3 -/**
4 - * An extremely simple non persistent cache system
3 +/*
4 + * an extremely simple non persistent cache system
5 5 * not as fast as using directly an array but more readable
6 6 *
7 7 * @since 1.7
8 8 */
@@ -8,20 +8,20 @@
8 8 */
9 9 class PLL_Cache {
10 10 protected $blog_id, $cache;
11 11
12 - /**
13 - * Constructor
12 + /*
13 + * constructor
14 14 *
15 15 * @since 1.7
16 16 */
17 17 public function __construct() {
18 18 $this->blog_id = get_current_blog_id();
19 - add_action( 'switch_blog', array( $this, 'switch_blog' ) );
19 + add_action( 'switch_blog', array( &$this, 'switch_blog' ) );
20 20 }
21 21
22 - /**
23 - * Called when switching blog
22 + /*
23 + * called when switching blog
24 24 *
25 25 * @since 1.7
26 26 *
27 27 * @param int $new_blog
@@ -29,22 +29,22 @@
29 29 public function switch_blog( $new_blog ) {
30 30 $this->blog_id = $new_blog;
31 31 }
32 32
33 - /**
34 - * Add a value in cache
33 + /*
34 + * add a value in cache
35 35 *
36 36 * @since 1.7
37 37 *
38 38 * @param string $key
39 - * @param mixed $data
39 + * @param mixed $data
40 40 */
41 41 public function set( $key, $data ) {
42 42 $this->cache[ $this->blog_id ][ $key ] = $data;
43 43 }
44 44
45 - /**
46 - * Get value from cache
45 + /*
46 + * get value from cache
47 47 *
48 48 * @since 1.7
49 49 *
50 50 * @param string $key
@@ -53,14 +53,12 @@
53 53 public function get( $key ) {
54 54 return isset( $this->cache[ $this->blog_id ][ $key ] ) ? $this->cache[ $this->blog_id ][ $key ] : false;
55 55 }
56 56
57 - /**
58 - * Clean the cache (for this blog only)
57 + /*
58 + * clean the cache (for this blog only)
59 59 *
60 60 * @since 1.7
61 - *
62 - * @param string $key
63 61 */
64 62 public function clean( $key = '' ) {
65 63 if ( empty( $key ) ) {
66 64 unset( $this->cache[ $this->blog_id ] );