承接 irfantoor/datastore 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

irfantoor/datastore

Composer 安装命令:

composer require irfantoor/datastore

包简介

Data Store of key, value pairs

README 文档

README

Storage of an key, value pair to a filesystem

Quick Start

Incstallation or inclusion in your project:

$ composer require irfantoor/datastore

Creating the Datastore:

$ds = new IrfanTOOR\Datastore('/yourpath/to/datatore/');

has($id)

Verify if the store has an entity with the requested id. returns true or false

$ds = new IrfanTOOR\Datastore('/yourpath/to/datatore/');

if ($ds->has('hello')) {
	echo $ds->get('hello');
}

set($id, $value, $meta = [])

Sets the value of an id:

$ds->set('hello', 'Hello');
$ds->set('hello-world', 'Hello World!');
# ...

Any other information regarding can be stored using the 3rd argument $meta.

$meta = [
    'meta' => [
        'keywords' => 'hello, world',
        'author'   => 'Jhon Doe',
        # ...
    ];
];

$ds->setComponents('hello', 'Hello World!', $meta);

info($id)

You can use the function info to retrive the information of an entity:

$info = $ds->info('hello-world');
print_r($info);

# Note: the information does not contain the value, which can be retrieved using
# the get function

get($id)

Returns the value associated to an id:

$contents = $ds->get('hello', 'Hello');
echo $contents;
echo $ds->get('hello-world');

remove($id)

Removes an entity assosiated to the provided id:

$ds->remove('hello');

addFile($key, $file, $meta = [])

You can add a file to the datastore, using this function.

$file = 'absolute\path\to\your\reference_file.txt';

$ds->addFile('reference', $file);

# or you can add some meta information
$ds->addFile('reference', $file, ['keywords' => 'reference', 'sites', 'index', '...']);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固