Download the PHP package wecodemore/wp-composer-config without Composer

On this page you can find all versions of the php package wecodemore/wp-composer-config. 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 wp-composer-config

Auto generate your wp-config.php

Latest Stable Version Total Downloads Latest Unstable Version License

Usage as Composer post-package-install script. Auto generation of wp-config.php files for WordPress installs. This package mostly is a convenience package that should make the build process easier.

What is it?

This package is a wp-config.php generator for WordPress that runs as Composer Script. It is based up on Vance Lucas PHPDotEnv package that offers a solution for adding a not version controlled/ignored .env file. The key/value data is made available as getenv(), $_ENV and $_SERVER variable afterwards. This config generator fetches a maintained list of configurable WordPress constants (like DB credentials) and builds a wp-config.php file in the WordPress root directory. This does not make increase security, but it helps preventing that you push sensitive information to a version controlled repository. It also makes it easier to maintain different environments like development, staging and production.

Example:

Example of the CLI process

How To: Setup

We recommend to use something like Andreys/"@Rarst" recipe for a site stack to get a thoughtful base structure for your project. Simply add this package to your stack.

"config" : {
    "vendor-dir": "wp-content/vendor"
},
// ...
"require" : {
    // ... other software installed to /var/www/wp-content/vendor
    "wecodemore/wp-composer-config" : "1.x-dev"
},

Then setup the script

"scripts" : {
    "post-package-install" : [
        "WCM\\WPComposerConfig\\WPConfigCommand::postPackageInstall"
    ]
},

Finally the script needs some variable set for the extra object:

"extra"   : {
    "wordpress-install-dir" : "path/to/wordpress",
    "wordpress-env-dir"     : "path/to/the/.env/file
 }

That's it.

If you want to run it on demand, you might want to give it a custom name that you can refer to on the command line. Avoid config as this is an internal Composer command:

"scripts" : {
    "wp-config" : [
        "WCM\\WPComposerConfig\\WPConfigCommand::postPackageInstall"
    ]
},

This way you can simply enter

composer wp-config

in your CLI and run it whenever it pleases you.

How To: Use it

The check list:

  1. Make sure that you add .env to your .gitignore file
  2. Take a look at the /ci folder in this package and copy the .env.example contents to your projects .env file. This is a blueprint of all major versions
  3. Adjust the settings that you find there
  4. Add the setup steps described above to your composer.json file
  5. Open your CLI and enter composer install
  6. Auth keys and Salt get fetched directly from the wordpess.org servers

Options

The following options are mirrored by the package over from PHPDotEnv:

Comment: Prefix a line with #.

Empty string: Set a = after your key without a value

The following option is new and only works for auto generating the wp-config.php file. This should make it easier to test different settings without adding and deleting the same constants over and over again.

Use WP Default: Set neither a =, nor a value for that key. Or just don't set it at all.

Internals

The package does not overwrite already existing Auth Keys and Salts. If you need them to be regenerated, please just delete them from the config by hand. They will get added again with a new set of hashes directly from wp.org.

FAQ

Q: I need Multisite

A: Switching from the (default) single site install to a multi site install is a multi step process that involves user interaction, changing the .htaccess file and adding constants step by step. We don't want to mess up your repo, so we don't do that by now. But if you think you can make it happen, just fork the repo and send a Pull Request.

Q: Shall I install it from GitHub or from Packagist?

A: The package is on Packagist and auto updated from GitHub instantly (using WebHooks).

Q: Will you implement X?

A: Just ask in a new issue. We discuss everything with everyone. If you got a PR, even better.

Q: What version should I refer to in my composer.json?

A: We use semantic versioning, so you will want to stay up to date with major versions.


All versions of wp-composer-config with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
guzzlehttp/guzzle Version ~5.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 wecodemore/wp-composer-config contains the following files

Loading the files please wait ....