Download the PHP package loadsys/cakephp-config-read without Composer

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

CakePHP-ConfigReadShell

Latest Version Build Status Coverage Status Total Downloads

A CakePHP plugin that provides a Shell to read an app's Configure vars from the command line.

Installation

Use the following as a guide for choosing your version based on the version of CakePHP installed.

CakePHP ConfigReadShell Plugin Tag Notes
^3.4 master 4.0.0 stable
3.3 3.3 3.0.0 stable
2.5 2.x 2.0.1 stable
1.3 1.x 1.0.1 stable

This will install the latest version.

Note: we don't expect to actively maintain or improve the 1.3 version. It's here because the project started life as a 1.3 Shell.

Requirements

Usage

Imagine the following defined in config/app.php:

To use this plugin, call it from the command line:

Format as a bash variable definition

Note that this format is automatically used whenever more than one key is returned (unless the --serialize switch has been used). For example, if you request a key that contains an array, all values in the array will be returned sequentially. Alternatively, if you pass multiple keys on the command line, they will all be returned. The format can also be forced using the -b or --bash command line switch:

Serializing output

It is possible serialize the output from ConfigReadShell so that it can be consumed by other PHP scripts more easily by using the -s or --serialize command line switch.

Requesting multiple keys on the command line will produce an array of those keys. Requesting a single scalar value will produce only that scalar value.

This switch always overrides both the --bash switch and the Shell's automatic bash formatting.

Potential Gotchas

"Consumed" Configure Vars

CakePHP 3 by default "consumes" some of its configs so as not to confuse developers. Configure::consume() removes the configuration key from Configure, making it unavailable to the rest of the app. At the time of this writing, it does this for the following keys/classes:

[Configure.Key] Class::configEnumerationMethod() Class::configFetchMethod()
[Cache] Cache::configured() Cache::getConfig()
[Datasources] ConnectionManager::configured() ConnectionManager::getConfig()
[EmailTransport] Email::configuredTransport() Email::getConfigTransport()
[Email] Email::configured() Email::getConfig()
[Log] Log::configured() Log::getConfig()
[Security.salt] (none) Security::getSalt()

The ConfigReadShell devotes about half of its codebase dealing with this for you, allowing you to continue to fetch values using the Configure path (Datasources.default.host -> localhost) while in the background it is actually querying ConnectionManager::getConfig('default')['host']. (This is particularly helpful if you are using Environment-Aware Configs.)

The "gotcha" here is that ConfigReadShell has to maintain a hard-coded list of Configure keys that are normally consumed, and how to access them in their new container. This is further complicated by the fact that not all consumed configs are loaded into or retrieved from their containers the same way, although the base assumption is that the container implements the StaticConfigTrait and so will have ::getConfig() and ::configured() available.

:warning: If your app uses Configure::consume() on any non-standard Configure key during bootstrapping, you will not be able to obtain any child values of those keys from the ConfigReadShell.

Contributing

Code of Conduct

This project has adopted the Contributor Covenant as its Translations are available.

Reporting Issues

Please use GitHub Isuses for listing any known defects or issues.

Development

When developing this plugin, please fork and issue a PR for any new development.

License

MIT

Copyright

Loadsys Web Strategies 2018


All versions of cakephp-config-read with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
cakephp/cakephp Version ^3.4
composer/installers Version ~1.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 loadsys/cakephp-config-read contains the following files

Loading the files please wait ....