Download the PHP package davidhirtz/yii2-config without Composer

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

Makes a project's application params editable in the admin. A project subclasses Hirtz\Config\Modules\Admin\Models\Config, declares the editable params as attributes with rules and labels, and the bundle renders them as a form under System. Saving writes the values back into the params file (config/params.php by default), records a trail entry and updates Yii::$app->params for the running request. Depends on davidhirtz/yii2-skeleton only.

Installation

The bundle bootstraps itself through extra.bootstrap (Hirtz\Config\Bootstrap): it registers the @config alias, the config message category, the config submodule of the admin module and its migration namespace, and adds Config::AUTH_CONFIG to the roles the admin dashboard offers. Then:

The migration creates the config permission, granted to the admin and manager roles. The params file must be writable by the web server; the bundle creates its directory but sets no permissions.

Configuration

Module properties, under modules.admin.modules.config:

Property Default Meaning
configFile '@root/config/params.php' The params file the form reads and writes, as an alias or path
defaultRoute 'config' Yii's default controller, so /admin/config opens the form

The bundle reads no component and no param of its own. The one definition a project sets is the container mapping of the model to its own subclass, plus the subclass itself:

A param in the application's sensitiveParams (the secrets each installed bundle declares: cookieValidationKey, mailerDsn, the API keys and tokens) is a password field and masked in the trail, as is any param a project validates with SensitiveAttributeValidator.

What the form shows is activeAttributes(): a param is editable when a validation rule names it, and every other key in the file survives a save untouched. i18nAttributes clones a field per configured language and stores claim_de beside claim in the same file; the rules go through getI18nRules(), which is what declares the _de variant, since nothing on a plain yii\base\Model does it for the subclass.

The admin page

Console commands

None.


All versions of yii2-config with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
davidhirtz/yii2-skeleton Version ^3.25
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 davidhirtz/yii2-config contains the following files

Loading the files please wait ...