initial commit; version 22.5.12042
This commit is contained in:
120
libs/Phpfastcache8/Entities/DriverIO.php
Normal file
120
libs/Phpfastcache8/Entities/DriverIO.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* This file is part of phpFastCache.
|
||||
*
|
||||
* @license MIT License (MIT)
|
||||
*
|
||||
* For full copyright and license information, please see the docs/CREDITS.txt file.
|
||||
*
|
||||
* @author Khoa Bui (khoaofgod) <khoaofgod@gmail.com> https://www.phpfastcache.com
|
||||
* @author Georges.L (Geolim4) <contact@geolim4.com>
|
||||
*
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Phpfastcache\Entities;
|
||||
|
||||
/**
|
||||
* Class DriverStatistic
|
||||
* @package phpFastCache\Entities
|
||||
*/
|
||||
class DriverIO
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $writeHit = 0;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $readHit = 0;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $readMiss = 0;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getWriteHit(): int
|
||||
{
|
||||
return $this->writeHit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $writeHit
|
||||
* @return DriverIO
|
||||
*/
|
||||
public function setWriteHit(int $writeHit): DriverIO
|
||||
{
|
||||
$this->writeHit = $writeHit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DriverIO
|
||||
*/
|
||||
public function incWriteHit(): DriverIO
|
||||
{
|
||||
$this->writeHit++;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getReadHit(): int
|
||||
{
|
||||
return $this->readHit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $readHit
|
||||
* @return DriverIO
|
||||
*/
|
||||
public function setReadHit(int $readHit): DriverIO
|
||||
{
|
||||
$this->readHit = $readHit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DriverIO
|
||||
*/
|
||||
public function incReadHit(): DriverIO
|
||||
{
|
||||
$this->readHit++;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getReadMiss(): int
|
||||
{
|
||||
return $this->readMiss;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $readMiss
|
||||
* @return DriverIO
|
||||
*/
|
||||
public function setReadMiss(int $readMiss): DriverIO
|
||||
{
|
||||
$this->readMiss = $readMiss;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DriverIO
|
||||
*/
|
||||
public function incReadMiss(): DriverIO
|
||||
{
|
||||
$this->readMiss++;
|
||||
return $this;
|
||||
}
|
||||
}
|
133
libs/Phpfastcache8/Entities/DriverStatistic.php
Normal file
133
libs/Phpfastcache8/Entities/DriverStatistic.php
Normal file
@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* This file is part of phpFastCache.
|
||||
*
|
||||
* @license MIT License (MIT)
|
||||
*
|
||||
* For full copyright and license information, please see the docs/CREDITS.txt file.
|
||||
*
|
||||
* @author Khoa Bui (khoaofgod) <khoaofgod@gmail.com> https://www.phpfastcache.com
|
||||
* @author Georges.L (Geolim4) <contact@geolim4.com>
|
||||
*
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Phpfastcache\Entities;
|
||||
|
||||
/**
|
||||
* Class DriverStatistic
|
||||
* @package phpFastCache\Entities
|
||||
*/
|
||||
class DriverStatistic
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $info = '';
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $size = 0;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $data = '';
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
protected $rawData;
|
||||
|
||||
/**
|
||||
* @return string Return info or false if no information available
|
||||
*/
|
||||
public function getInfo(): string
|
||||
{
|
||||
return $this->info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $info
|
||||
* @return $this
|
||||
*/
|
||||
public function setInfo(string $info): self
|
||||
{
|
||||
$this->info = $info;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int Return size in octet or false if no information available
|
||||
*/
|
||||
public function getSize(): int
|
||||
{
|
||||
return $this->size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $size
|
||||
* @return $this
|
||||
*/
|
||||
public function setSize(int $size)
|
||||
{
|
||||
$this->size = $size;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $data
|
||||
* @return $this
|
||||
*/
|
||||
public function setData($data): self
|
||||
{
|
||||
$this->data = ($data ?: '');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRawData()
|
||||
{
|
||||
return $this->rawData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $raw
|
||||
* @return $this
|
||||
*/
|
||||
public function setRawData($raw): self
|
||||
{
|
||||
$this->rawData = $raw;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPublicDesc(): array
|
||||
{
|
||||
return [
|
||||
'Info' => 'Cache Information',
|
||||
'Size' => 'Cache Size',
|
||||
'Data' => 'Cache items keys',
|
||||
'RawData' => 'Cache raw data',
|
||||
];
|
||||
}
|
||||
}
|
63
libs/Phpfastcache8/Entities/ItemBatch.php
Normal file
63
libs/Phpfastcache8/Entities/ItemBatch.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* This file is part of phpFastCache.
|
||||
*
|
||||
* @license MIT License (MIT)
|
||||
*
|
||||
* For full copyright and license information, please see the docs/CREDITS.txt file.
|
||||
*
|
||||
* @author Khoa Bui (khoaofgod) <khoaofgod@gmail.com> https://www.phpfastcache.com
|
||||
* @author Georges.L (Geolim4) <contact@geolim4.com>
|
||||
*
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Phpfastcache\Entities;
|
||||
|
||||
use DateTimeInterface;
|
||||
|
||||
/**
|
||||
* Class ItemBatch
|
||||
* @package phpFastCache\Entities
|
||||
*/
|
||||
class ItemBatch
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $itemKey;
|
||||
|
||||
/**
|
||||
* @var DateTimeInterface
|
||||
*/
|
||||
protected $itemDate;
|
||||
|
||||
/**
|
||||
* ItemBatch constructor.
|
||||
* @param string $itemKey
|
||||
* @param DateTimeInterface $itemDate
|
||||
*/
|
||||
public function __construct(string $itemKey, DateTimeInterface $itemDate)
|
||||
{
|
||||
$this->itemKey = $itemKey;
|
||||
$this->itemDate = $itemDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getItemKey(): string
|
||||
{
|
||||
return $this->itemKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DateTimeInterface
|
||||
*/
|
||||
public function getItemDate(): DateTimeInterface
|
||||
{
|
||||
return $this->itemDate;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user