Download the PHP package stillat/proteus without Composer

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

This library provides utilities and features for parsing, updating, and writing Laravel style PHP configuration files.

Installation

To install Proteus issue the following command, or at stillat/proteus to your composer.json file:

Basic Usage

The ConfigWriter facade will automatically load and manage your existing Laravel configuration files, and dramatically simplifies the usage of the configuration writer:

You may also write many configuration items at once:

If you only want the document contents (without writing to disk), you may use the preview and previewMany counterparts:

Preventing Changes to Configuration Items

You may use the guard method to prevent changes to specific configuration entries:

If a change is detected for app.key, an instance of GuardedConfigurationMutationException will be thrown.

You may also restrict changes on entire configuration namespaces:

Or to just a sub-section of the configuration:

Enabling Function Rewrites

Changes to function calls (such as env) can are disabled by default. To enable them, you may call the ignoreFunctionCalls method with false:

Preserving Configuration Values

You may ignore certain configuration value updates by using the preserve method. The preserve method accepts an array of strings (dot notation is also supported!).

Intermediate Usage

For more control to remove, replace, and even merge array values with existing configuration values, we can use the edit helper method. This helper method expects a configuration namespace, and returns access to a convenient wrapper to perform a variety of configuration changes.

In the following example, we will start an edit instance for the app configuration namespace, modify a few values, and save the results to a $document variable:

We can save ourselves some keystrokes by supplying a key/value pair to the set method:

To save the changes instead of assigning them to a value, we can call save instead of preview:

Removing Existing Configuration Values

You may use the remove method to remove an existing configuration item:

This method will also remove the configuration key from the configuration file - not just the value!

Replacing an Existing Configuration Value

You may use the replace method to completely replace an existing configuration item:

Merging Array Configuration Items

You may use the merge method to add new values to an existing configuration item. For example, the following would add the SomeProvider and SomeOtherProvider class providers to the list of application providers:

The merge method will make sure there are no duplicates in the resulting configuration values.

Performing Multiple Actions

You may perform multiple actions at once by chaining them. Chained actions are performed in the order they are specified.

`

Writing Function Calls to Configuration Files

You may also write Laravel function calls as part of the generated configuration by using the f helper method:

The configuration output would then be similar to the following:

The following functions are available:

Advanced Usage

Given the following input configuration file:

We can manually create a configuration updater and apply our changes manually:

After running, $newConfigContents would contain output similar to the following:

And yes, it did add the new-key value as the default value for the env call instead of replacing the lookup key :)

Features

Road Map

There will undoubtedly be changes required overtime, and if you find something not working, please open an issue with the input you are supplying and the expected results. Bonus points if you add a test case for it :)

License

MIT License. See LICENSE.MD


All versions of proteus with dependencies

PHP Build Version
Package Version
Requires nikic/php-parser Version ^5
laravel/framework Version ^10.0 || ^11.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 stillat/proteus contains the following files

Loading the files please wait ....