PHPackages                             wiryono.lau/php-config-db - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wiryono.lau/php-config-db

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wiryono.lau/php-config-db
=========================

Configuration Databasse

00PHP

Since Apr 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/wiryonolau/php-config-db)[ Packagist](https://packagist.org/packages/wiryono.lau/php-config-db)[ RSS](/packages/wiryonolau-php-config-db/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP Configuration Database
==========================

[](#php-configuration-database)

Manage application configuraion inside database, each configuration are separate by userspace.

Configuration can be save in File / Database such as MySQL.

Required ZF3

Installation
------------

[](#installation)

```
composer require wiryonolau/php-config-db
```

Test using Docker
-----------------

[](#test-using-docker)

```
#Start php-cli docker container
make start

#Build composer dependency
docker exec -it php-config-db composer-update
docker exec -it php-config-db gosu 1000 bin/configdb

#If you want to use mysql as backend run this
make start-mysql
make connect
docker exec -it php-config-db gosu 1000 bin/configdb initdb
```

Usage
-----

[](#usage)

Specify configuration in your application with key "configdb"

Config Parameters :

- config\_adapter:
    - ConfigDB\\Adapter\\FileConfigAdapter : Configuration is save inside folder
    - ConfigDB\\Adapter\\DatabaseConfigAdapter : Configruation is save inside specified database
    - Any class that implement ConfigDB\\Adapter\\ConfigAdapterInterface
- database\_adapter :
    - An array of database configuration - check Zend\\Db\\Adapter\\Adapter for format
    - Any class that implement Zend\\Db\\Adapter\\AdapterInterface
- database\_table : table name to save configuration database
- cache\_config : (bool) whether to cache config
- cache\_adapter : cacheing adapter
    - An array of cache configuration
    - Any class that implement Zend\\Cache\\Storage\\StorageInterface
- default\_userspace : default userspace to use , default is "global"

### Example :

[](#example-)

MyModule\\config\\configdb.config.php

```
