PluginProbe
Polylang / 2.0
Polylang v2.0
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 +7 -12 2.82.0 View file →
@@ -1,11 +1,8 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 /**
7 - * An extremely simple non persistent cache system
4 + * an extremely simple non persistent cache system
8 5 * not as fast as using directly an array but more readable
9 6 *
10 7 * @since 1.7
11 8 */
@@ -12,9 +9,9 @@
12 9 class PLL_Cache {
13 10 protected $blog_id, $cache;
14 11
15 12 /**
16 - * Constructor
13 + * constructor
17 14 *
18 15 * @since 1.7
19 16 */
20 17 public function __construct() {
@@ -22,9 +19,9 @@
22 19 add_action( 'switch_blog', array( $this, 'switch_blog' ) );
23 20 }
24 21
25 22 /**
26 - * Called when switching blog
23 + * called when switching blog
27 24 *
28 25 * @since 1.7
29 26 *
30 27 * @param int $new_blog
@@ -33,14 +30,14 @@
33 30 $this->blog_id = $new_blog;
34 31 }
35 32
36 33 /**
37 - * Add a value in cache
34 + * add a value in cache
38 35 *
39 36 * @since 1.7
40 37 *
41 38 * @param string $key
42 - * @param mixed $data
39 + * @param mixed $data
43 40 */
44 41 public function set( $key, $data ) {
45 42 $this->cache[ $this->blog_id ][ $key ] = $data;
46 43 }
@@ -45,9 +42,9 @@
45 42 $this->cache[ $this->blog_id ][ $key ] = $data;
46 43 }
47 44
48 45 /**
49 - * Get value from cache
46 + * get value from cache
50 47 *
51 48 * @since 1.7
52 49 *
53 50 * @param string $key
@@ -57,13 +54,11 @@
57 54 return isset( $this->cache[ $this->blog_id ][ $key ] ) ? $this->cache[ $this->blog_id ][ $key ] : false;
58 55 }
59 56
60 57 /**
61 - * Clean the cache (for this blog only)
58 + * clean the cache (for this blog only)
62 59 *
63 60 * @since 1.7
64 - *
65 - * @param string $key
66 61 */
67 62 public function clean( $key = '' ) {
68 63 if ( empty( $key ) ) {
69 64 unset( $this->cache[ $this->blog_id ] );