Download the PHP package inspirenmy/yii2-config without Composer

On this page you can find all versions of the php package inspirenmy/yii2-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 yii2-config

Yii2 extension - Config

Description

Yii2 extension which allows to get application parameters, text or email templates from database tables or from default config, to import and to manage them from admin panel dynamically.

This extension contains following components:

1) Config component 2) Template engine component 3) Email template engine and composer engine component

Contents

Install

1) Get from composer

or add dependency at composer.json in "require" section

2) Create DB tables for config storage and templates storage manually or using migration mechanism (copy files demo/tbl_config.php, demo/tbl_template.php and demo/tbl_email_template.php to migrations folder).

Config component

Allows to get params from database table or if it doesn't exists then from following source:

Allows to set params while initializing any components:

Configure

Simple setup

Flexible setup

There are several params of Configurator class which can be modified:

Configure of event handler

There are several params of component class which can be modified:

Important

Folder specified as folderStorage should be exist. Here fileStorage file will be created if some config params will be exist. Recommended to create folder previously with .gitkeep file inside.

Usage

Possibility of modifying system configs and templates by web application admin is target of this extension so all usages will realize modify function.

Try to use complex name in dotted style as param key at format: moduleName.paramName or moduleName.submoduleName.paramName. Do not use appconfig as moduleName. This is reserved.

Frontend

Get param of config application

Get application config param from DB or \Yii::$app->params array.

Getter sequentially passes following steps. If it finds out value the pass breaks. Flow here:

or

If param's value doesn't exists at DB table (or cached view) it will be added to missing config file by handler (fileStorage). After that web application administrator can import missing values (and all defaults also) into DB table and modify them.

If some config param need more secure level of setup you can use local param file to avoid commit them at public repo.

Get array of config's parameters by key's mask

Get array of config's parameters by key's mask from DB.

Getter sequentially passes following steps. If it finds out value the pass breaks. Flow here:

For example,

will return all params linked with someModule:

Get application's param

Get application param from DB or \Yii::$app.

For example,

will return your application name storing at DB or if it absent directly from application config (\Yii::$app->name).

Using Configurator for configuring other components
Modify config file directly

Configurator can be used for pre-configuring other components at config file directly. These components should contain and use ConfigurableTrait (example see at demo).

For example configuring sms component with sms.senderNumber param:

Bootstraps of components

Either Configurator can pre-configure other component implementing bootstrap interface.

Add config component to app bootstrap section:

Then fill bootstrap component section:

and add cloud_amazons3_bucket, cloud_amazons3_baseurl, cloud_amazons3_baseurl to params array (or set default params file) either add cloud_amazons3_key, cloud_amazons3_secret to local params to protect them.

Backend

In backend part should be used ConfiguratorAdmin class or inheritances. It use ConfiguratorAdminTrait which allow import missing config from fileStorage file or default config from defaultConfigFile file (if exists).

Administrator of the web application can:

Template engine component

Allows to get template from database table or if it doesn't exists then from template source file. Before return it replaces all matches of template variables.

Configuring process is very similar with Config component except name of class - use inspirenmy\template\TemplateEngine.

Usage process is very similar to get param of config application. Getter sequentially passes following steps. If it finds out value the pass breaks. Flow here:

or

If template doesn't exists at DB table it will be added to missing template file by handler (fileStorage). After that web application administrator can import missing templates into DB table and modify them.

Other processes are similar to Config component's processes.

Email template engine and composer engine component

Allows to get email params like subject, template's name from DB and then use template from prepared the file store (where it can be modified from backend by admin) or if it doesn't exists then from mail template source file.

Configuring process is very similar with Config component except name of class - use inspirenmy\template\Mailer.

Usage process is very similar to get param of config application. Getter sequentially passes following steps. If it finds out value the pass breaks. Flow here:

or more detail

If template doesn't exists at DB table it will be added to missing template file by handler (fileStorage). After that web application administrator can import missing templates into DB table and modify them.

If param redirectEmail will be configured then all emails will be redirected to this email (field to will be ignored). If param isTransferEnabled is set to false then mailer's option useFileTransport will be set to true instead of real transfer mail.

Other processes are similar to Config component's processes.


All versions of yii2-config with dependencies

PHP Build Version
Package Version
Requires php Version >5.5.0
yiisoft/yii2 Version ~2.0.0
inspirenmy/yii2-models Version *
inspirenmy/yii2-helpers Version *
inspirenmy/yii2-traits Version *
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 inspirenmy/yii2-config contains the following files

Loading the files please wait ....