Download the PHP package cube/composer-dist-installer without Composer

On this page you can find all versions of the php package cube/composer-dist-installer. 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 composer-dist-installer

Composer Dist Installer

Type Status
Build Build Status Code Coverage Scrutinizer Code Quality
Packagist Latest Stable Version Total Downloads Latest Unstable Version License

Automatically installs .dist files when you run composer install in your project, and optionally populates them with data using a very simple and intuitive templating syntax.

This project is designed to be framework-agnostic. All you need is to be using Composer to manage your project's dependencies.

Installation

Simply use Composer to install by running:

composer require cube/composer-dist-installer:~1.0@beta

Usage

Add the following into your root composer.json file:

The file config/autoload/database.config.php will then be created based on the template provided at config/autoload/database.config.php.dist and by asking you for any parameters requested in the .dist file.

By default, the dist file is assumed to be in the same place than the parameters file, suffixed by .dist. This can be changed in the configuration:

The script handler will ask you interactively for parameters which are requested in the .dist file, using optional default values.

If composer is run in a non-interactive mode, the default values will be used for missing parameters.

Warning: If a configuration file already exists in the destination, you will be promted whether you want to override it. If you choose to overwrite, a backup file will be created right next to the config file. You're in charge of manually merging the differences between the new and the old file - and then deleting the old file.

Multiple Files

You can specify more than one file to be processed by using the following alternate syntax:

Template Syntax

Before the template files (.dist files) are copied to the final destination, a processor will look for any parameters you may have included in the template and ask you for their value.

The syntax for a parameter is {{QUESTION|DEFAULT}}.

For example, consider the following template:

When installing the project, composer will ask you for all the information and use defaults where necessary. The prompt would look something like this:

And the final file will look like this:

Environment Variables

It is possible to use environment values in order to set default values for parameters. The syntax for that is {{Question|=ENV[VARIABLE_NAME]}}, where VARIABLE_NAME is the environment value that will provide the default.

In the example above, the following line used the USER environment variable as a default value:

Multiple defaults for a parameter

It is also possible to have multiple default values (eg {{QUESTION|DEFAULT1|DEFAULT2}}. This can be useful if you want to use environment variables as a default and, in case the environment variable is not set, fall back to a hardcoded default value.

Hence, you can write in your dis file for instance:

If the MY_VAR environment variable is set to 'foobar', the question will be:

If the MY_VAR environment variable is not set, the question will be:

Non-interactive mode

When composer is launched with --no-interaction option, the default value is applied. This can be a good option for deployment process, in case you use environment variables in your dist file.

LICENSE

See LICENSE.txt file in this same package.

Credits

Copyright (c) 2015 by Cu.be Solutions

Authors:


All versions of composer-dist-installer with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
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 cube/composer-dist-installer contains the following files

Loading the files please wait ....