Download the PHP package danielrhodeswarp/kimino-config without Composer

On this page you can find all versions of the php package danielrhodeswarp/kimino-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kimino-config

Kimino Config

Sounds weird. What is it?

It's a Laravel 5 package to quickly enable database setting and getting of administrator or application level settings; settings that might be tinkered with during the lifetime of an application.

What is it good for?

It's good for implementation preparedness around project specification that you sense - or know - will change in future. Also good for trialling different algorithms. Also good for experimenting with implementation or design specification that can't quite be decided by everyone. Also good for rulepacks.

So what's new in v0.0.5?

What does it come with?

How do I install this thing?

  1. composer require danielrhodeswarp/kimino-config in your Laravel 5 project's home folder. (Or you can add danielrhodeswarp/kimino-config to your project's composer.json file - and then run composer install - if you know what you are doing.)
  2. In the 'providers' bit of your project's config/app.php file add Danielrhodeswarp\KiminoConfig\KiminoConfigServiceProvider::class.
  3. php artisan migrate --path=vendor/danielrhodeswarp/kimino-config/src/database/migrations to run the migration to create the kimino_configs table.
  4. (If you want to override package config it's php artisan vendor:publish --tag=config. If you want to edit the views it's php artisan vendor:publish --tag=views. If you want to override the config to use the Foundation view it's php artisan vendor:publish --tag=public. Or of course publish everything with php artisan vendor:publish. Note that Kimino Config will work, using defaults, without publishing anything.)

How do I give it a quick check?

After installation, your-project.url/kimino-config will now show the only view that Kimino Config has - a page to view all the settings in the database and to update any of their values if necessary.

You won't have any settings yet. As a test you can add some dummy settings with php artisan kimino:seed-examples.

php artisan kimino:get-config will dump out all of the settings, something like:

Setting Value Valid values
other_leg arbitrary-value
other_news no yes,no
something_auth_method digest basic,digest
something_trial_months 6

php artisan kimino:get-config other_news will dump out the specified setting, like:

Setting Value Valid values
other_news no yes,no

php artisan kimino:set-config other_leg will prompt for - and set if valid - a new value for the specified setting.

What do these settings look like in the database?

Settings have four fields in the database (and also an auto-incrementing id field):

Field Can be null? Description
setting no Name of setting. Words separated by underscores and must contain at least one underscore. Like something_or_other. Settings are grouped on the HTML form by prefix which is the word before the first underscore.
value no Value of setting. Will be empty string, any string or - if valid_values is not empty - one of the strings in valid_values
valid_values yes If empty, then the setting is free text. If set to a comma-separated (no spaces) list of words, then the setting value can only be one of those words (and this will be enforced when updating values with the HTML form or the Artisan command).
user_hint yes A human friendly explanation of the setting for whosoever might be tinkering with it on the HTML form

How do I add my own settings?

To add a basic free text setting you simply need to add a new database entry containing the setting name with relevant prefix in setting and the current or default value for the setting in setting. I would always recommend adding a nice, descriptive hint in user_hint at setting creation time too!

To add a setting with a restricted set of values, for example "queue emails: yes or no" or "heading font: courier, verdana or times", follow the same steps as above but also put the value restrictions in valid_values like yes,no or courier,verdana,times (respectively).

Note that, by design, there is no programmatic way to add a new setting. You can of course use a Laravel seed (created with, say, php artisan make:seeder SeedMyKiminos) something like:

This seed can be run with php artisan db:seed --class=SeedMyKiminos which will add the settings to the database.

How do I use this in my project?

Here's a simple example:

Note that KiminoConfig::getSetting('some-setting') will return NULL if some-setting does not exist in the database (hence setting values themselves can't be NULL). So, here is a more robust example:

Here's a cute way to handle settings that have some valid_values set:

You can of course use a smelly old switch / case instead.

Sounds great so far. Any gotchas to keep in mind?

What's next on your TODO list?

What's bugging you?

Why is everything in this readme a question?

Why not? :D


All versions of kimino-config with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~5.1
php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package danielrhodeswarp/kimino-config contains the following files

Loading the files please wait ....