Exemple #1
0
 * ----------------------------------------------------
 * Set environment
 * ----------------------------------------------------
 * Define path and the environment locations.
 */
$env = new \Weloquent\Config\Environment($root_path);
/**
 * ----------------------------------------------------
 * Load .env file
 * ----------------------------------------------------
 */
$location = $env->which();
if (empty($location)) {
    printf('<h1>%s</h1>', 'Unable to define the environment. Make sure to define your hostname.');
}
$loaded = $env->load($location);
if (empty($loaded)) {
    printf('<h1>%s</h1>', 'Unable to locate your environment file.');
}
/**
 * ----------------------------------------------------
 * Check required vars
 * ----------------------------------------------------
 */
$check = $env->check(array('APP_ENV', 'APP_THEME', 'DB_NAME', 'DB_USER', 'DB_PASSWORD', 'DB_HOST', 'WP_HOME', 'WP_SITEURL'), $loaded);
/**
 * ----------------------------------------------------
 * Populate environment vars
 * ----------------------------------------------------
 */
if ($check) {