Download the PHP package devuri/wp-env-config without Composer

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

WordPress Environment Configuration

Unit Tests

Introduction

wp-env-config is a small yet powerful package that simplifies the process of defining configuration constants in WordPress. By leveraging PHP dotenv, this package enables you to securely store sensitive configuration data in environment variables, which is a best practice for building and deploying software according to the twelve-factor app methodology.

Note This repository houses the fundamental components of wp-env-config. If you are developing an application, please utilize wp-env-app located in this repository: wp-env-app.

Installation

To use wp-env-config, you can install it via Composer. Run the following command in your terminal:

or for existing projects

Alternatively, you can add devuri/wp-env-config to your project's composer.json file:

Once installed, you can begin using the package in your WordPress project.

Usage

To get started, create a .env file in the root directory of your project. In this file, define the environment variables you wish to use as configuration constants, update the database credentials and other settings as needed.

Full list of Environment Variables

Then, in your wp-config.php file, add the following code:

This will load the environment variables from the .env file and define them as configuration constants.

You can define as many constants as you need using this approach.

Setup Options and Environment

Environment Constants.

Debug must be on and 'development' set as WP_ENVIRONMENT_TYPE in the .env file.

This will output the following:

Global helper functions.

asset()

The asset() function will generate a URL for an asset.

asset_url()

The asset_url() URL for the asset directory.

env()

The env() function can be used to get the value of an environment variable.

Kernel.

Kernel $args

We can use the Kernel $args to setup a custom directory structure.

CI/CD

We can use a GitHub Actions workflow to automate the deployment process.

https://github.com/marketplace/actions/ssh-remote-commands

Headless Mode

Corcel Corcel is a collection of PHP classes built on top of Eloquent ORM (from Laravel framework), that provides a fluent interface to connect and get data directly from a WordPress database. https://github.com/corcel/corcel

Headless Mode A helper plugin for putting WordPress in "headless mode". Designed for when WordPress is the CMS for a headless/ decoupled WordPress site.

https://github.com/Shelob9/headless-mode

Redis Object Cache

[!WARNING]

Please note that configuring Redis Object Cache can be a complex process, as it relies on an external Redis server to function properly. If you have little or no experience with setting up Redis servers, or configuring applications that use Redis, it is recommended that you seek assistance or consult with an expert before attempting to use this plugin.

The Redis Object Cache: https://wordpress.org/plugins/redis-cache/ paired with https://github.com/phpredis/phpredis/blob/develop/INSTALL.md will supercharge web application.

Its best to use phpredis we have had issues in the past while testing where the cron jobs start failing, also if you decide to go for Redis Object Cache pro, phpredis is required.

Why

The aim of this package is to simplify the definition of WordPress configuration constants by leveraging PHP dotenv to access environment variables stored in a .env file. By utilizing environment variables in this way, we can enhance the security of our WordPress installation by avoiding the storage of sensitive credentials in our code.

This approach adheres to the twelve-factor app methodology for building and deploying software, specifically principle three, which emphasizes the importance of storing configuration data in the environment. By implementing this package, we can follow this best practice and ensure that our WordPress instance is both secure and maintainable.

Development and Support Status (in-Beta)

⚠️ This project is currently in active development. If you're considering using it for production, please feel free to get in touch, and we'll gladly offer additional guidance and support. We also encourage and welcome any issues and pull requests related to this framework.

We are still in the beta testing phase. While it's actively under development, we are actively seeking user feedback and making improvements. You're welcome to join our Slack community, where we have ongoing and active discussions.


All versions of wp-env-config with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
defuse/php-encryption Version ^2.4
devuri/cpt-meta-box Version ^0.4
devuri/dot-access Version ^0.2.2
devuri/encryption Version ^0.3
devuri/secure-password Version ^0.1
devuri/uuid-generator Version ^0.0.1
filp/whoops Version ^2.15
johnpbloch/wordpress Version ^6.2
symfony/error-handler Version ^5.0
symfony/filesystem Version ^5.4
symfony/var-dumper Version ^5.4
vlucas/phpdotenv Version ^5.2
psr/log Version ^1.1
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 devuri/wp-env-config contains the following files

Loading the files please wait ....