Download the PHP package oohology/dotenvwriter without Composer

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

DotEnvWriter

Interface for editing .env files in PHP

Build Status


Note: This is probably not advisable for use in production, but could be handy for automating installation tasks, etc.

Basic Usage

In general, you will open a .env file, use the set method to append or replace some values, and then call the save method to write the result.

Open an environment file and replace a value:

Also supports fluent interface:

Output File

There are multiple ways to read from a source file, make some changes, and write the result to a different output file. The end result is the same, so choose whichever method best fits your use case:

Or alternately:

Or using the load() method:

Comments

The set() method takes a $comments parameter. If omitted (or set to null), any existing comment from the source file with be kept intact. If a $comment is provided it will overwrite the existing comment. Providing a zero-length $comment will cause the comment to be deleted.

Examples: Set a comment

Delete a comment

Keep existing comment

Export

The parser supports a bash-style export prefix on any line. The set() method takes an $export variable as its 4th argument. Example: By default, keep the existing state

Or change it by passing a boolean

Casting booleans

By default boolean values will not be stored as true or false.

To enable casting booleans you should call the castBooleans() method.

Example:

Default behaviour

After calling castBooleans() method

Read the Value of a Variable

The get method allows you to find the value of an existing given environment variable. It returns false if the variable doesn't exist, or an array containing the details of the line from the source file.

Source: export ENV="dev" # dev or live?

Get command: $writer->get('ENV');

Result:

Writing Blank/Comment Lines

The line method appends a single unprocessed line of output to the file. It could be used to insert blank lines or comments. If you wish to append a new variable, the set method should be used instead to prevent duplicates.


All versions of dotenvwriter with dependencies

PHP Build Version
Package Version
Requires php Version >=5.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 oohology/dotenvwriter contains the following files

Loading the files please wait ....