Download the PHP package pixelbrackets/application-context without Composer

On this page you can find all versions of the php package pixelbrackets/application-context. 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 application-context

Application Context

Version Build Status Made With License

The »Application Context« library allows to define the context of the current environment, in order to adapt configuration options depending on the stage an app is running on.

For example if an application is running in Production mode, it should send mails and not create any log files. In Development mode however it should send mails, but to a different recipient, and create excessive log files.

An environment variable sets the context, whichs is retrieved using this class.

The main advantage of this approach is, that the code may stay the same on all stages, but only configuration values may change, depending on the context.

Requirements

Installation

Packagist Entry https://packagist.org/packages/pixelbrackets/application-context/

Source

https://gitlab.com/pixelbrackets/application-context/

Mirror https://github.com/pixelbrackets/application-context/

Usage

  1. Set the application context using an environment variable

    A context may contain arbitrary sub-contexts. They are delimited with a slash. For example Production/Integration or Development/LocalMachines/JohnDoe.

    The top-level contexts however, must be one of Development, Testing or Production. Testing should be used to run unit tests only. Use Production and Development and any sub-context for all stages.

    or pass to the script like this

    💡 Hint: The package helhum/dotenv-connector lets you store these variables in an .env file and automatically parse it.

  2. Integrate the ApplicationContext class

    If the context variable is empty, then Production is the default.

  3. Change code or configuration depending on the given context

    Available methods to check the top-level context are isProduction(), isTesting() and isDevelopment().

    If the context object is casted to a string, then the return value is the context string as set in the environment variable. This may be used to load different files as in this example.

License

GNU General Public License version 2 or later

The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html.

Attributions:

Author

Dan Untenzu (@pixelbrackets)

Changelog

./CHANGELOG.md

Contribution

This script is Open Source, so please use, patch, extend or fork it.


All versions of application-context with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.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 pixelbrackets/application-context contains the following files

Loading the files please wait ....