Skip to content

Instantly share code, notes, and snippets.

@0aveRyan
Created January 4, 2019 16:51
Show Gist options
  • Save 0aveRyan/42bace3a08560a3ba1f6e1326c226f09 to your computer and use it in GitHub Desktop.
Save 0aveRyan/42bace3a08560a3ba1f6e1326c226f09 to your computer and use it in GitHub Desktop.
Universal Lando wp-config.php file grabbing creds from the env variable
<?php
/**
* !!! PLEASE CYCLE YOUR SALTS !!!
*
* @package WordPress
*/
/**
* Locate & Decode Database Credentials from Lando Info
*/
// BEGIN CONFIGURATION
$db = 'database';
// END CONFIGURATION
/* -------------------------------------------- */
// BEGIN UNIVERSAL CONFIG FOR LANDO //
$lndo = json_decode( getenv('LANDO_INFO'), TRUE );
$creds = $lndo[$db]['creds'];
$internal = $lndo[$db]['internal_connection'];
define( 'DB_NAME', $creds['database'] );
define( 'DB_USER', $creds['user'] );
define( 'DB_PASSWORD', $creds['password'] );
define( 'DB_HOST', $internal['host'] . ':' . $internal['port'] );
// END UNIVERSAL CONFIG FOR LANDO //
/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define( 'AUTH_KEY', '&q@/FbhL6.[fN.zD,Gd6uCc8Kpz0w`cjwE>,u=Az|CX]VPrzxGYA`=>G|.O>Di9U' );
define( 'SECURE_AUTH_KEY', 'iQQlH*7K!wFGHTfrx.O?ifn-e`JZvQFS?QQl+kw0rHhgF9C2`I0pUTzt*(+@yxT+' );
define( 'LOGGED_IN_KEY', '{^%|{4VS|e$:MLlWP.z.-7!T|!h!xrWdiKJ3XM[:{`=`ErD.XgG;UlqzZc]6awst' );
define( 'NONCE_KEY', 'kYnb|6VC_70U|i|oqP+1]LXZ(R?a)_d<oi=4n3@Z3]C*1PxM5K? _!& 8K~]G vo' );
define( 'AUTH_SALT', '7fdYLSee@f^b3VR$KflX4QfUeLhl&D&^S)?i+Y3&Qwrwa6Yaww6ti(+1X&>=>PdA' );
define( 'SECURE_AUTH_SALT', 'R?ynhg%(M{`Ybu#W_ol#~}N<ck^4*vBF3vUm1Ig^},jUWanBJLBYD,GDTpK`h[/0' );
define( 'LOGGED_IN_SALT', 'F#}#l5m~V- m<R;{~m ~zXsy_d@i%=H^1h< (+n~YaPS{x&z83%x{Vb,NVy|0Wr ' );
define( 'NONCE_SALT', 'D2M;`eumoh^ZJ*<<OC4$QSJrTaCK<BCL8oQ4N8>peECL_PFr[zX.P1^2Vi@,Oy^q' );
define( 'WP_CACHE_KEY_SALT', 'No1-i0!|MdSsZ%HnAt4v1o:dAdRY]ess$Vsy4,WZ?]M1/ZvkP2vJ c;,PKH-mrc=' );
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'SCRIPT_DEBUG', true );
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) )
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment