| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * @package Polylang | |
| 4 | - */ | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * An extremely simple non persistent cache system |
| 8 | 5 | * not as fast as using directly an array but more readable |
| @@ -9,23 +6,11 @@ | ||
| 9 | 6 | * |
| 10 | 7 | * @since 1.7 |
| 11 | 8 | */ |
| 12 | 9 | class PLL_Cache { |
| 13 | - /** | |
| 14 | - * Current site id. | |
| 15 | - * | |
| 16 | - * @var int | |
| 17 | - */ | |
| 18 | - protected $blog_id; | |
| 10 | + protected $blog_id, $cache; | |
| 19 | 11 | |
| 20 | 12 | /** |
| 21 | - * The cache container. | |
| 22 | - * | |
| 23 | - * @var array | |
| 24 | - */ | |
| 25 | - protected $cache; | |
| 26 | - | |
| 27 | - /** | |
| 28 | 13 | * Constructor |
| 29 | 14 | * |
| 30 | 15 | * @since 1.7 |
| 31 | 16 | */ |
| @@ -39,9 +24,8 @@ | ||
| 39 | 24 | * |
| 40 | 25 | * @since 1.7 |
| 41 | 26 | * |
| 42 | 27 | * @param int $new_blog |
| 43 | - * @return void | |
| 44 | 28 | */ |
| 45 | 29 | public function switch_blog( $new_blog ) { |
| 46 | 30 | $this->blog_id = $new_blog; |
| 47 | 31 | } |
| @@ -52,9 +36,8 @@ | ||
| 52 | 36 | * @since 1.7 |
| 53 | 37 | * |
| 54 | 38 | * @param string $key |
| 55 | 39 | * @param mixed $data |
| 56 | - * @return void | |
| 57 | 40 | */ |
| 58 | 41 | public function set( $key, $data ) { |
| 59 | 42 | $this->cache[ $this->blog_id ][ $key ] = $data; |
| 60 | 43 | } |
| @@ -76,9 +59,8 @@ | ||
| 76 | 59 | * |
| 77 | 60 | * @since 1.7 |
| 78 | 61 | * |
| 79 | 62 | * @param string $key |
| 80 | - * @return void | |
| 81 | 63 | */ |
| 82 | 64 | public function clean( $key = '' ) { |
| 83 | 65 | if ( empty( $key ) ) { |
| 84 | 66 | unset( $this->cache[ $this->blog_id ] ); |