定制 rumd3x/php-persistence 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rumd3x/php-persistence

Composer 安装命令:

composer require rumd3x/php-persistence

包简介

Store and retrieve data without a database.

README 文档

README

Store persistent data and retrieve it without a database.

Installation

To install via composer just run

  composer require rumd3x/php-persistence

Usage

Getting started

Create an instance of the Persistence Engine passing a string with the driver name. Every driver is a totally different database. If data is getting too hard to manage you should probably be using more drivers.

use Rumd3x\Persistence\Engine;
$driver = 'test-db';
$db = new Engine($driver);

Storing data

You can store an instance of any object, arrays of mixed data, strings, etc.

When you retrieve your data, you'll get back exactly what you've stored.

When your data is stored, it's being put at the bottom of a stack.

$array = ['hello' => 'world', 1234, 1.666];
$db->store($array);

Retrieving data

The engine uses FIFO.

So when you retrieve your data, you'll be retrieving from the top of the stack.

If the driver has nothing stored in it, it will return null

Also, when you retrieve your data, it will be erased from the stack, so if you are using it again, make sure to store it back.

$data = $db->retrieve();

统计信息

  • 总下载量: 944
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 10
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固