Download the PHP package casperwilkes/laravel-environment_detector2 without Composer

On this page you can find all versions of the php package casperwilkes/laravel-environment_detector2. 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 laravel-environment_detector2

Laravel Environment Detector

This is a simple environment detector made for working with multiple environments. This package should not need to be run very often, if at all after it's initial setup.

This is great for multiple environment setups.

Sometimes you don't want to save your .env files to your repository, in that case, add .env* to your .gitignore file.

Requirements

This package is only available for Laravel Framework versions 7 and above. If you're looking for a package that works with 5 and 6 use casperwilkes/environment_detector.

Installation

There are a couple steps necessary to get the environment detector up and running.

Composer

To install the package through composer:

Laravel Publish

Once you have installed through composer, you will want to publish the assets of the project

This will publish the necessary bootstrap files and the config file.

The bootstrap file will be located at ./bootstrap/environment_detector.php.

The config will be at ./config/environment_detector.php

Check Config

After you've published your config file, you'll want to update it with your environments, and perspective short names.

By default, there are some environments already setup.

You can use whatever short names you want to describe your environment stage. This will create the shortname for the .env files.

For the environment name, you'll want the machines hostname. You can run hostname from the command line to get it.

For example, if you had 2 production environments called prod_one, and prod_two, you would use those for the short name, and use the machine's hostname for the environment field.

Package Publish

After you've published the vendor assets, you will want to publish the package.

To publish the package, run:

This will create the necessary environment files, and update your App.php to require the environment_detector. A backup of your previous version of App.php will be backed up in the same directory.

This will work it's way through your environment_detector config, and create a .env file for each environment found.

So, for our previous example, we'll get 4 different .env files.

Remove Package

If for whatever reason you wish to remove the package, you can un-publish the package.

Run

This will remove the bootstrap files, and restore your app from the backup process.

note: If no backup is found, it will attempt to remove the require statement from App.php.

Usage

There are a couple usage options for both the envdetector commands.

Publish

For the publish command, there are 3 options:

Notes

For the bootstrap option, a backup copy of the original App.php is created and stored in the same directory. This will be used in case you've made previous changes to App.php, and you wish to revert back.

For the configs option, it will detect if a particular config already exists, and whether it should be overwritten. A prompt will appear asking for permission before assuming. If not configs are already setup, it will go ahead and create them. You can choose to overwrite all, or only some.

This is useful for when you've only added 1 or 2 new environments.

The original .env.example and .env will always remain untouched by this package.

Un-publish

For the un-publish command, there are 3 options:


All versions of laravel-environment_detector2 with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2.5
illuminate/console Version ^7.0
illuminate/support Version ^7.0
laravel/framework Version ^7.0
vlucas/phpdotenv Version ^4.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 casperwilkes/laravel-environment_detector2 contains the following files

Loading the files please wait ....