GithubHelp home page GithubHelp logo

aroma's Introduction

Aroma

Build Status Coverage Total Downloads License

DB-based configuration for CakePHP 3.

Install

Using Composer:

composer require gourmet/aroma:^1.0.x-dev

You then need to load the plugin. You can use the shell command:

bin/cake plugin load Gourmet/Aroma

or by manually adding statement shown below to bootstrap.php:

Plugin::load('Gourmet/Aroma');

Usage

For the most basic setup, you don't need to do much:

// config/bootstrap.php
use Cake\Core\Configure;
use Gourmet\Aroma\Core\Configure\Engine\DbConfig;

Configure::config('db', new DbConfig());

If you'd like to use a custom table for storing configuration:

// config/bootstrap.php
use Cake\Core\Configure;
use Cake\ORM\TableRegistry;
use Gourmet\Aroma\Core\Configure\Engine\DbConfig;

Configure::config('db', new DbConfig(TableRegistry::get('MyConfigurations')));

Of if you just want to use a different caching engine configuration for storing the database query results:

// config/bootstrap.php
use Cake\Core\Configure;
use Gourmet\Aroma\Core\Configure\Engine\DbConfig;

Configure::config('db', new DbConfig(null, 'customCacheConfigAlias'));

Once you have set it up, you can use like any other Configure engine, using the key you have assigned it:

Configure::read('site_name', 'db');
Configure::write('site_name', 'My Personal Blog', 'db');

Patches & Features

  • Fork
  • Mod, fix
  • Test - this is important, so it's not unintentionally broken
  • Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
  • Pull request - bonus point for topic branches

Bugs & Feedback

http://github.com/gourmet/aroma/issues

License

Copyright (c) 2015, Jad Bitar and licensed under The MIT License.

aroma's People

Contributors

jadb avatar lipedjow avatar phillaf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aroma's Issues

how to use tutorial request

hi

thanks for sharing your plugin.

can you please post a tutorial (for beginners) on how to use the plugin to replace the default config engine in https://github.com/cakephp/app with the database one

i tried and get a The datasource configuration "default" was not found. I attached my bootstrap.php file
bootstrap.txt

thanks in advance for any help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.