定制 orchid/settings 二次开发

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

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

orchid/settings

最新稳定版本:5.0.0

Composer 安装命令:

composer require orchid/settings

包简介

Settings this is key-value storage

README 文档

README

Unit tests Latest Stable Version Total Downloads License

The simplest persistent data store using a key to access a value.

Installation

Run this at the command line:

$ composer require orchid/settings

After do the migration:

$ php artisan migrate

Usage

To add a new value to the repository you need to use:

<?php

use Orchid\Settings\Setting;

Setting::set($key, $value);

The transferred value will be converted to JSON, and upon receipt, decoding will occur, this allows you to place not only simple types, but also arrays in the storage.

To get the value:

<?php

/**
* @param string|array $key
* @param string|null $default
*/
Setting::get($key, $default);
// or using the helper function
setting($key, $default);

By default, each item cached before it is changed, in cases if you need to get a value not from the cache, you need to use the getNoCache method.

Setting::getNoCache($key, $default = null);

Note. When transferring keys as an array, subsequent updates of values will not automatically flush the cache.

To delete a value:

<?php

/**
* @param string|array $key
* @param string|null $default
*/
Setting::forget($key);

Please note that you can get or delete several values from the repository at once, for this you need to pass an array with the names of the keys as the first argument.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 17.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 5
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 4
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固