Browse Source

PHPDocs for cache, Format

master
Anton Terekhov 12 years ago
parent
commit
1e0d1aaa38
  1. 3
      cache/Cache.php
  2. 3
      cache/CacheKey.php
  3. 6
      cache/Cacher.php
  4. 9
      cache/MemcacheCache.php
  5. 3
      classes/Format.class.php

3
cache/Cache.php

@ -35,7 +35,6 @@ abstract class Cache
* Delete item from the cache
*
* @param string $key
* @param int $value
* @return bool
*/
abstract public function del($key);
@ -68,7 +67,7 @@ abstract class Cache
* Replace value of the existing item
*
* @param string $key
* @param mixed $var
* @param mixed $value
* @param int $expire
* @return bool
*/

3
cache/CacheKey.php

@ -13,7 +13,7 @@ class CacheKey
{
/**
* @var Cacher
* @var Cache
*/
protected $cacher;
@ -62,6 +62,7 @@ class CacheKey
/**
* @param mixed $value
* @return bool
*/
public function set($value)
{

6
cache/Cacher.php

@ -19,6 +19,12 @@ class Cacher
*/
static protected $caches = array();
/**
* @param $cacher
* @param null|string $config
* @return Cache
* @throws InitializationException
*/
static public function get($cacher, $config = null)
{
if (!isset(self::$caches[$cacher])) {

9
cache/MemcacheCache.php

@ -17,6 +17,9 @@ class MemcacheCache extends Cache
*/
protected $connection = null;
/**
* @var null|string
*/
protected $key_salt = null;
/**
@ -26,7 +29,6 @@ class MemcacheCache extends Cache
*/
protected $expire = 3600;
public function __construct($config)
{
$this->connection = new Memcache();
@ -76,7 +78,7 @@ class MemcacheCache extends Cache
* Delete item from the cache
*
* @param string $key
* @param int $value
* @internal param int $value
* @return bool
*/
public function del($key)
@ -121,8 +123,9 @@ class MemcacheCache extends Cache
* Replace value of the existing item
*
* @param string $key
* @param mixed $var
* @param mixed $value
* @param int $expire
* @internal param mixed $var
* @return bool
*/
public function replace($key, $value, $expire = 0)

3
classes/Format.class.php

@ -47,6 +47,7 @@ class Format
* @param mixed $int
* @param bool $currency - показывать валюту
* @param bool $show_decimals - показывать или нет дробную часть
* @return string
*/
static public function int2money($int = 0, $currency = false, $show_decimals = true)
{
@ -169,7 +170,7 @@ class Format
* Преобразует дату в таймстамп.
*
* @param mixed $time
* @return TimeFormat
* @return int|bool
*/
static public function date2int($time)
{

Loading…
Cancel
Save