PHPDocs for cache, Format
This commit is contained in:
3
cache/Cache.php
vendored
3
cache/Cache.php
vendored
@ -35,7 +35,6 @@ abstract class Cache
|
|||||||
* Delete item from the cache
|
* Delete item from the cache
|
||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param int $value
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
abstract public function del($key);
|
abstract public function del($key);
|
||||||
@ -68,7 +67,7 @@ abstract class Cache
|
|||||||
* Replace value of the existing item
|
* Replace value of the existing item
|
||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $var
|
* @param mixed $value
|
||||||
* @param int $expire
|
* @param int $expire
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
3
cache/CacheKey.php
vendored
3
cache/CacheKey.php
vendored
@ -13,7 +13,7 @@ class CacheKey
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Cacher
|
* @var Cache
|
||||||
*/
|
*/
|
||||||
protected $cacher;
|
protected $cacher;
|
||||||
|
|
||||||
@ -62,6 +62,7 @@ class CacheKey
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function set($value)
|
public function set($value)
|
||||||
{
|
{
|
||||||
|
6
cache/Cacher.php
vendored
6
cache/Cacher.php
vendored
@ -19,6 +19,12 @@ class Cacher
|
|||||||
*/
|
*/
|
||||||
static protected $caches = array();
|
static protected $caches = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $cacher
|
||||||
|
* @param null|string $config
|
||||||
|
* @return Cache
|
||||||
|
* @throws InitializationException
|
||||||
|
*/
|
||||||
static public function get($cacher, $config = null)
|
static public function get($cacher, $config = null)
|
||||||
{
|
{
|
||||||
if (!isset(self::$caches[$cacher])) {
|
if (!isset(self::$caches[$cacher])) {
|
||||||
|
9
cache/MemcacheCache.php
vendored
9
cache/MemcacheCache.php
vendored
@ -17,6 +17,9 @@ class MemcacheCache extends Cache
|
|||||||
*/
|
*/
|
||||||
protected $connection = null;
|
protected $connection = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var null|string
|
||||||
|
*/
|
||||||
protected $key_salt = null;
|
protected $key_salt = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,7 +29,6 @@ class MemcacheCache extends Cache
|
|||||||
*/
|
*/
|
||||||
protected $expire = 3600;
|
protected $expire = 3600;
|
||||||
|
|
||||||
|
|
||||||
public function __construct($config)
|
public function __construct($config)
|
||||||
{
|
{
|
||||||
$this->connection = new Memcache();
|
$this->connection = new Memcache();
|
||||||
@ -76,7 +78,7 @@ class MemcacheCache extends Cache
|
|||||||
* Delete item from the cache
|
* Delete item from the cache
|
||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param int $value
|
* @internal param int $value
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function del($key)
|
public function del($key)
|
||||||
@ -121,8 +123,9 @@ class MemcacheCache extends Cache
|
|||||||
* Replace value of the existing item
|
* Replace value of the existing item
|
||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $var
|
* @param mixed $value
|
||||||
* @param int $expire
|
* @param int $expire
|
||||||
|
* @internal param mixed $var
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function replace($key, $value, $expire = 0)
|
public function replace($key, $value, $expire = 0)
|
||||||
|
@ -47,6 +47,7 @@ class Format
|
|||||||
* @param mixed $int
|
* @param mixed $int
|
||||||
* @param bool $currency - показывать валюту
|
* @param bool $currency - показывать валюту
|
||||||
* @param bool $show_decimals - показывать или нет дробную часть
|
* @param bool $show_decimals - показывать или нет дробную часть
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
static public function int2money($int = 0, $currency = false, $show_decimals = true)
|
static public function int2money($int = 0, $currency = false, $show_decimals = true)
|
||||||
{
|
{
|
||||||
@ -169,7 +170,7 @@ class Format
|
|||||||
* Преобразует дату в таймстамп.
|
* Преобразует дату в таймстамп.
|
||||||
*
|
*
|
||||||
* @param mixed $time
|
* @param mixed $time
|
||||||
* @return TimeFormat
|
* @return int|bool
|
||||||
*/
|
*/
|
||||||
static public function date2int($time)
|
static public function date2int($time)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user