samokspv/cakephp-db-configure 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

samokspv/cakephp-db-configure

Composer 安装命令:

composer require samokspv/cakephp-db-configure

包简介

Use it if you want to save and read serialized data into DB.

README 文档

README

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

DBConfigure plugin for CakePHP 2.2+

Use it if you want to save and read serialized data into/from DB (DBConfigure::read = (Configure::write + DBConfigure::write)).

Installation

cd my_cake_app/app
git clone git://github.com/samokspv/cakephp-DBConfigure.git Plugin/DBConfigure

or if you use git add as submodule:

cd my_cake_app
git submodule add "git://github.com/samokspv/cakephp-DBConfigure.git" "app/Plugin/DBConfigure"

then add plugin loading in Config/bootstrap.php

CakePlugin::load('DBConfigure');

Usage

In any place of your code:

App::uses('DBConfigure', 'DBConfigure.Utility');

For example:
// save to DB
DBConfigure::write('TestSetting', array(
	'key_1' => array(
		'key_1_1' => 'value_1_1',
		'key_1_2' => array(
			'key_1_2_1' => 'value_1_2_1'
		)
	)
));
// read from DB
DBConfigure::read('TestSetting'); 
	/*return: array(
		'key_1' => array(
			'key_1_1' => 'value_1_1',
			'key_1_2' => array(
				'key_1_2_1' => 'value_1_2_1'
			)
		)
	)*/
DBConfigure::read('TestSetting.key_1');
	/*return: array(
		'key_1_1' => 'value_1_1',
		'key_1_2' => array(
			'key_1_2_1' => 'value_1_2_1'
		)
	)*/
DBConfigure::read('TestSetting.key_1.key_1_2');
	/*return: array(
		'key_1_2_1' => 'value_1_2_1'
	)*/
DBConfigure::read('TestSetting.key_1_3', 'defaultValue_1_3'); 
	/*return: defaultValue_1_3*/

// save to DB
DBConfigure::write('TestSetting.key_1.key_1_2', 'value_1_2_1_update');
// read from DB
DBConfigure::read('TestSetting.key_1.key_1_2');
	/*return: array(
		'key_1_2_1' => 'value_1_2_1_update'
	)*/

// save to session
Configure::write('TestSetting.key_1', 'value_1');
Configure::write('TestSetting.key_2', 'value_2');
// save to DB
DBConfigure::write('TestSetting.key_2', 'value_2_update');
DBConfigure::write('TestSetting.key_3', 'value_3');
// read from DB
DBConfigure::read('TestSetting');
	/*return: array(
		'key_1' => 'value_1',
		'key_2' => 'value_2_update',
		'key_3' => 'value_3'
	)*/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固