{"id":20134460,"url":"https://github.com/wearerequired/composer-wp-config","last_synced_at":"2025-07-23T16:32:29.899Z","repository":{"id":34377486,"uuid":"178186180","full_name":"wearerequired/composer-wp-config","owner":"wearerequired","description":"🧃 Composer plugin to create a wp-config.php when installing WordPress.","archived":false,"fork":false,"pushed_at":"2024-03-27T09:19:09.000Z","size":91,"stargazers_count":9,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-20T14:47:26.322Z","etag":null,"topics":["composer","composer-plugin","configuration","dotenv","php","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wearerequired.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-28T11:05:36.000Z","updated_at":"2024-04-04T21:52:46.000Z","dependencies_parsed_at":"2024-11-13T21:09:41.664Z","dependency_job_id":"b7bc7bac-9635-40cb-a438-eff59628a1ac","html_url":"https://github.com/wearerequired/composer-wp-config","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/wearerequired/composer-wp-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearerequired%2Fcomposer-wp-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearerequired%2Fcomposer-wp-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearerequired%2Fcomposer-wp-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearerequired%2Fcomposer-wp-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wearerequired","download_url":"https://codeload.github.com/wearerequired/composer-wp-config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearerequired%2Fcomposer-wp-config/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266713523,"owners_count":23972935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","composer-plugin","configuration","dotenv","php","wordpress"],"created_at":"2024-11-13T21:09:37.763Z","updated_at":"2025-07-23T16:32:29.455Z","avatar_url":"https://github.com/wearerequired.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# composer-wp-config\n\n[![Latest Stable Version](https://poser.pugx.org/wearerequired/composer-wp-config/v/stable)](https://packagist.org/packages/wearerequired/composer-wp-config)\n[![Latest Unstable Version](https://poser.pugx.org/wearerequired/composer-wp-config/v/unstable)](https://packagist.org/packages/wearerequired/composer-wp-config)\n\nA plugin for Composer to create the WordPress configuration file which automagically defines constants from a .env file. Also includes path of Composer's autoloader in wp-config.php.\n\n## Installation\n\nVia Composer\n\n```\ncomposer require johnpbloch/wordpress wearerequired/composer-wp-config\n```\n\nCopy [`.env.example`](res/.env.example) and save it as `.env`. By default the variables are searched in a `.env` file in the same directory as `wp-config.php` .\n\n### List of required variables\n\n* `_HTTP_HOST` (Used when `$_SERVER['SERVER_NAME']` is not set, like WP-CLI.)\n* `DB_NAME`\n* `DB_USER`\n* `DB_PASSWORD`\n* `AUTH_KEY`\n* `SECURE_AUTH_KEY`\n* `LOGGED_IN_KEY`\n* `NONCE_KEY`\n* `AUTH_SALT`\n* `SECURE_AUTH_SALT`\n* `LOGGED_IN_SALT`\n* `NONCE_SALT`\n\nSee also the list of [default constants](#default-constants).\n\n### Customize path to .env file\n\nYou can override the path(s) with the following extra in your `composer.json`:\n\n```json\n{\n    \"extra\": {\n        \"wp-config-env-paths\": [\n            \"../\",\n            \"../configs\"\n        ]\n    }\n}\n```\n\nNote that the path must be relative to the `wp-config.php` file. Run `composer build-wp-config` to rebuild the `wp-config.php` file.\n\n## Features\n\n* Creates `wp-config.php` one level above the WordPress installation.\n* The `wp-config.php` includes the path to Composer's autoloader.\n* Searches for `.env` file with the help of [PHP dotenv](https://github.com/vlucas/phpdotenv).\n* Defines all variables as constants unless a constant is already set.\n* Defines reasonable default values for database, object cache, debug, URL, and path constants.\n* Use `{{DIR}}` as placeholder in variable values to get it replaced with `__DIR__` of `wp-config.php`.\n* Supports `URL_DEVELOPMENT`, `URL_STAGING`, and `URL_PRODUCTION` for [WordPress Stage Switcher](https://github.com/roots/wp-stage-switcher). Requires at least v2.1.\n* Supports loading `wp-config-prepend.php` before and `wp-config-append.php` after the default config as part of `wp-config.php`.\n* Loads the WordPress plugin API early so actions and filters can be used.\n\n## Default Constants\n\nIf the following variables are not defined they will be assigned a default value:\n\n| Variable name | Default value |\n|--------------------|------------------------------------|\n| `WP_ENV` | `'development'` |\n| `WP_ENVIRONMENT_TYPE` | Value of `WP_ENV` |\n| `QM_DISABLED` | `true` |\n| `SAVEQUERIES` | `false` |\n| `WP_DEBUG` | `false` |\n| `WP_DISABLE_FATAL_ERROR_HANDLER` | Value of `WP_DEBUG` |\n| `WP_DEBUG_LOG` | `false` |\n| `WP_DEBUG_DISPLAY` | `false` |\n| `SCRIPT_DEBUG` | `false` |\n| `DISALLOW_FILE_MODS` | `true` |\n| `DB_HOST` | `'localhost'` |\n| `DB_CHARSET` | `'utf8'` |\n| `DB_COLLATE` | `''` |\n| `$table_prefix` | `'wp_'` |\n| `WP_CACHE_KEY_SALT` | Value of `WP_ENV` |\n| `WP_HOME` | Based on `$_SERVER['SERVER_NAME']`/`_HTTP_HOST` and `$_SERVER['HTTPS']` |\n| `WP_SITEURL` |  Value of `WP_HOME` |\n| `WP_CONTENT_FOLDER_NAME` | `'content'` |\n| `WP_CONTENT_DIR` | `__DIR__ . '/' . WP_CONTENT_FOLDER_NAME` |\n| `WP_CONTENT_URL` | `WP_HOME . '/' . WP_CONTENT_FOLDER_NAME` |\n\n## Planned Features\n\n* Allow to change required variables via `composer.json`.\n* Allow to change variables not used as a constant via `composer.json`.\n* Let us know what you think is missing…\n\n\u003cbr\u003e\n\n[![a required open source product - let's get in touch](https://media.required.com/images/open-source-banner.png)](https://required.com/en/lets-get-in-touch/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearerequired%2Fcomposer-wp-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwearerequired%2Fcomposer-wp-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearerequired%2Fcomposer-wp-config/lists"}