Download the PHP package neam/php-app-config without Composer

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

PHP App Config

A PHP framework-agnostic approach to make the current config available to PHP applications and shell-scripts.

For use by the application wherever it may be fit, for instance in the application's / PHP framework's configuration files.

Installation

Before:

'db' => array(
    'connectionString' => 'mysql:host=localhost;dbname=db',
    'emulatePrepare' => true,
    'username' => 'root',
    'password' => 'supersecret',
    'charset' => 'utf8',
    'enableParamLogging' => true, // Log SQL parameters
    //'schemaCachingDuration'=>3600*24,
),

After:

'db' => array(
    'connectionString' => 'mysql:host=' . DATABASE_HOST . (defined('DATABASE_PORT') && DATABASE_PORT != '' ? ';port=' . DATABASE_PORT : '') . ';dbname=' . DATABASE_NAME,
    'emulatePrepare' => true,
    'username' => DATABASE_USER,
    'password' => DATABASE_PASSWORD,
    'charset' => 'utf8',
    'enableParamLogging' => true, // Log SQL parameters
    //'schemaCachingDuration'=>3600*24,
),

How it works

Configuration directives are looked for in the following places:

The include.php file will load a file (defaulting to project-root/config/local/include.php) that defines what application-specific configuration directives to expect.

To change the expected config include file, set the CONFIG_INCLUDE environment variable to the path to the include relative to the project root. For instance, in order to use project-root/config/remote/include.php, set the CONFIG_INCLUDE environment variable to config/remote/include.php.

Within the config include file, you define which directives to expect using the Config::expect() method:

Config::expect("DATABASE_URL", $default = null, $required = true);

The include.php file will then call Config::defineConstants() which will define expected configuration directives as constants.

Using the example config includes

The included example configuration includes sample config profiles used to deploy to Heroku-style services and/or running the code locally.

Remote deployment (Docker Cloud / Platform as a Service)

Example - Heroku

Your app should now run on Heroku using the expected config vars as PHP constants.

Local

The example local config include will first expect the remote, then load the overrides.php file, followed by a non-versioned file called secrets.php. To use the local configuration:

Your app should now run locally using the expected config vars as PHP constants.

Useful commands

To show your current config, you can run the following in a shell:

php -d variables_order="EGPCS" vendor/neam/php-app-config/export.php

To use the config in a shell-script:

source vendor/neam/php-app-config/shell-export.sh
# now the config is available to the shell-script

To export the current configuration to a file which can be sourced by a shell script:

php -d variables_order="EGPCS" vendor/neam/php-app-config/export.php > .exported.php-app-config.inc.sh

All versions of php-app-config with dependencies

PHP Build Version
Package Version
Requires vlucas/phpdotenv Version v1.0.8
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 neam/php-app-config contains the following files

Loading the files please wait ....