Download the PHP package red-freak/modular-monolith-laravel-env without Composer

On this page you can find all versions of the php package red-freak/modular-monolith-laravel-env. 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 modular-monolith-laravel-env

Warning This Package is still work in progress!

Warning The package is basically functional, but there is no logic to handle the files in a repo.

Modular Monolith Laravel Env

The task of this package is to manage module dotnev-files used by the Laravel integration of phpdotenv. To store these files in source control without populating its contents to tjhe public the package is also based on Laravels environment encrypting by a shared secret. This way the package can also be used for forge or envoyer deployments.

Systemrequirements

Installation

To install you have to replace the Kernel-classes of Laravel.

app/Http/Kernel.php

app/Console/Kernel.php

Testing

run in develope

How to use

getting started

The package assumes that the including package is structured following the modular monolith talk with the additional dotenv-files by this logic:

If your structure is different you have to implement the ModularEnvironmentApplication-Contract into your application. By the method ModularEnvironmentApplication::additionalEnvFiles() the package will recognize different paths (* and ** are allowed and used like in the .gitignore).

using the variables

Variables form the default .env are accessed like before with the env()-helper.

Variables from the modules are accessed the same way with the difference that they are prefixed with the module name in SNAKE_CASE (caps) and __. E.g. the Variable HELLO=WORLD from the file /src/FooBar/.env can be accessed by env('FOO_BAR__HELLO').

tasks

tasks for 0.3.0 - encrypting the files

recommendations

use the following in your .gitignore

Why do I?

Why do I have to replace Kernel-Classes?

I see, replacing the Kernel is a big issue. But .env-files are bootstrapped before anything else, so we have to hook something before everything else. The Kernels are present and inheriting, so it's a good point to hook in.

Need to create my own Application class?

You don't have to it's just a possibility to determine a custom path-structure on your dotenv-files. The default "setting" will be to guess files in /src/**/.

Need to create my own Application class if I have a custom path-structure on my .env-files?

The problem for this package is, that we want to hook a behaviour which is deep in the functionality of Laravel. At the moment the dotenv-files are loaded there is just a "stub" of the Application, there is no way to use config or env. So this seemed the best option to not produce unnecessary disk-requests. This is especially important for applications handling hundreds of requests per second.

Licence

This package is free to use as stated by the buy me a coffee if you want :D.


All versions of modular-monolith-laravel-env with dependencies

PHP Build Version
Package Version
Requires vlucas/phpdotenv Version ^5.4.1
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 red-freak/modular-monolith-laravel-env contains the following files

Loading the files please wait ....