GithubHelp home page GithubHelp logo

michaloo / wp-cli-environmentalize Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 1.0 5 KB

WP-CLI package to "environmentalize" Wordpress installation

PHP 100.00%
wp-cli wordpress-installation mariadb-image mysql-image docker wordpress-development wordpress-setup wordpress-configuration

wp-cli-environmentalize's Introduction

WP-CLI Environmentalize

WP-CLI package to "environmentalize" Wordpress installation.

Makes wp-config.php to load settings from ENV variables.

Installation

In your WP-CLI installation run:

wp package install michaloo/wp-cli-environmentalize

Usage

In your Wordpress installation run

wp environmentalize

If no wp-config.php file is found, one based on default WP-CLI template is created. Created wp-config.php file has getenv injected into Wordpress define functions. If you want to replace exisiting wp-config.php, please remove or rename it before the command.

In addition to the config, there is .env file with all available ENV variables created.

Except DB_NAME, DB_USER, DB_PASSWORD all ENV variables names match WordPress constants names. DB_CHARSET Wordpress constant value is set from DB_CHARSET ENV variable.

In mentioned three cases DB_ prefix is changed to MYSQL_ to make it compatible with MySQL/MariaDB Docker images ([refer to ]).

Related projects

wp-cli-environmentalize's People

Contributors

danielbachhuber avatar michaloo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

futerzak

wp-cli-environmentalize's Issues

Consider adding functional tests to this project

Functional tests are an integral ingredient of highly-quality, maintainable commands. WP-CLI tries to make it as easy as possible to add functional tests to your package with its wp scaffold package-tests command:

https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-tests

I'd encourage you to consider adding functional tests to your package :) By starting your functional tests early on, it also makes it much easier to maintain your project over time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.