phpolar/phpolar-storage

此包已被弃用且不再维护。作者建议使用 phpolar/storage 包。

一个方便的工具,用于加速应用程序开发中的数据存储创建。

2.0.0 2023-09-02 23:34 UTC

This package is auto-updated.

Last update: 2024-05-28 01:27:11 UTC


README

phpolar.svg

PHPolar 数据存储抽象

Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

用于创建具有改进类型安全性的持久层存储库、服务等。

用法

class KafkaStorage extends AbstractStorage
{
    public function __construct(
        // ...
    ) {
        parent::__construct();
        // ...
    }
    // ...
}


$key0 = new ItemKey(uniqid());

$kafkaStorage->storeByKey($key0, $data);

$item0 = $kafkaStorage->getByKey($key0);

$numItems = $kafkaStorage->count();

$allItems = $kafkaStorage->getAll();

$kafka->removeByKey($key0);

$kafka->clear();