Download the PHP package winter/laravel-config-writer without Composer

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

Laravel Config Writer

Version Tests License Discord

A utility to easily create and modify Laravel-style PHP configuration files and environment files whilst maintaining the formatting and comments contained within. This utility works by parsing the configuration files using the PHP Parser library to convert the configuration into an abstract syntax tree, then carefully modifying the configuration values as required.

This library was originally written as part of the Storm library in Winter CMS, but has since been extracted and repurposed as a standalone library.

Installation

Usage

PHP array files

You can modify Laravel-style PHP configuration files - PHP files that return a single array - by using the Winter\LaravelConfigWriter\ArrayFile class. Use the open method to open an existing file for modification, or to create a new config file.

You can set values using the set method. This method can be used fluently, or can be called with a single key and value or an array of keys and values.

You can also set deep values in an array value by specifying the key in dot notation, or as a nested array.

To finalise all your changes, use the write method to write the changes to the open file.

If desired, you may also write the changes to another file altogether.

Or you can simply render the changes as a string.

Function calls as values

Function calls can be added to your configuration file by using the function method. The first parameter of the function method defines the function to call, and the second parameter accepts an array of parameters to provide to the function.

Constants as values

Constants can be added to your configuration file by using the constant method. The only parameter required is the name of the constant.

Sorting the configuration file

You can sort the configuration keys alphabetically by using the sort method. This will sort all current configuration values.

By default, this will sort the keys alphabetically in ascending order. To sort in the opposite direction, include the ArrayFile::SORT_DESC parameter.

Environment files

This utility library also allows manipulation of environment files, typically found as .env files in a project. The Winter\LaravelConfigWriter\EnvFile::open() method allows you to open or create an environment file for modification.

You can set values using the set method. This method can be used fluently, or can be called with a single key and value or an array of keys and values.

Note: Arrays are not supported in environment files.

You can add an empty line into the environment file by using the addEmptyLine method. This allows you to separate groups of environment variables.

To finalise all your changes, use the write method to write the changes to the open file.

If desired, you may also write the changes to another file altogether.

Or you can simply render the changes as a string.

License

This utility library is open-sourced software licensed under the MIT license.

Security vulnerabilities

Please review our security policy on how to report security vulnerabilities.


All versions of laravel-config-writer with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4.0 || ^8.0
nikic/php-parser Version ^4.10
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 winter/laravel-config-writer contains the following files

Loading the files please wait ....