Skip to content

Configuration reference

Symfony configuration

Edit or create the file config/packages/sword.yaml then configure it to suit your needs.

Below is the default configuration:

yaml
sword:
    app_namespace: 'App\\'
    child_theme_language_path: '%kernel.project_dir%/translations/%sword.child_theme_translation_domain%'
    child_theme_translation_domain: 'mychildtheme' # must be configured in your app
    public_services: []
    table_prefix: 'wp_'
    widgets_namespace: 'App\\Widget\\'
    widgets_path: '%kernel.project_dir%/src/Widget/'
    wordpress_content_dir: '%kernel.project_dir%/wp/content'
    wordpress_core_dir: '%kernel.project_dir%/wp/core'
    wordpress_host: '' # Use this if you're behind a reverse-proxy. Example: 'https://domain.com'

Environment variables

TIP

All environment variables have their alternative with _FILE suffix if you need to provide a value contained in a file (e.g. with Docker secrets).

Variable nameDefault value
WORDPRESS_DB_NAMEwordpress
WORDPRESS_DB_USERuser
WORDPRESS_DB_PASSWORDpassword
WORDPRESS_DB_HOSTmysql
WORDPRESS_DB_CHARSETutf8mb4
WORDPRESS_DB_COLLATEempty
WORDPRESS_TABLE_PREFIXwp_
WORDPRESS_DEBUGfalse
WORDPRESS_DEBUG_LOGfalse
WORDPRESS_DEBUG_DISPLAYfalse
WORDPRESS_DISABLE_FATAL_ERROR_HANDLERtrue
WORDPRESS_REDIS_HOSTredis
WORDPRESS_REDIS_PASSWORDpassword
WORDPRESS_CACHE_KEY_SALTrandom string
WORDPRESS_DISABLE_WP_CRONtrue
WORDPRESS_CACHEtrue
WORDPRESS_HTTP_BLOCK_EXTERNALfalse
WORDPRESS_AUTO_UPDATE_COREfalse
WORDPRESS_AUTOMATIC_UPDATER_DISABLEDtrue
WORDPRESS_SITE_URLhttps://localhost
WORDPRESS_CONFIG_EXTRAempty
WORDPRESS_AUTH_KEYrandom string
WORDPRESS_SECURE_AUTH_KEYrandom string
WORDPRESS_LOGGED_IN_KEYrandom string
WORDPRESS_NONCE_KEYrandom string
WORDPRESS_AUTH_SALTrandom string
WORDPRESS_AUTH_KEYrandom string
WORDPRESS_SECURE_AUTH_SALTrandom string
WORDPRESS_LOGGED_IN_SALTrandom string
WORDPRESS_NONCE_SALTrandom string

Released under the MIT License.