承接 marcinjozwikowski/settingsindbbundle 相关项目开发

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

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

marcinjozwikowski/settingsindbbundle

最新稳定版本:0.1.4

Composer 安装命令:

composer require marcinjozwikowski/settingsindbbundle

包简介

A Symfony2 bundle that allows an easy key-value storage in DB

README 文档

README

A Symfony2 bundle that allows an easy key-value storage in DB

Installation

  1. Add as composer dependency:
composer require marcin_jozwikowski/settings_in_db_bundle
  1. Add in application kernel:
class AppKernel extends Kernel
{
    public function registerBundles()
    {
    //...
    $bundles[] = new \MarcinJozwikowski\SettingsInDBBundle\SettingsInDBBundle();
    return $bundles;
    }
}
  1. Update database schema:
php app/console doctrine:schema:update --force

##Usage

  1. Access DB stored values through service:
  //in controller
  $val = $this->get('settings_in_db_service')->read('key', 'defaultValue');

##Configuration

Default configuration:

   settings_in_db:
      allow_inserts: true
      return_null_on_not_found: false 
      read_all_entries_at_first_use: true
  • allow_inserts - if set to true, persists a new key-value pair if none is found
  • return_null_on_not_found - if nothing found and allow_inserts = false, returns null instead of throwing an exception
  • read_all_entries_at_first_use - if set to true loads all records at first use and searches in internal array insted of querying

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-01