2017 © Pedro Peláez
 

library wp-yaml-loader

Simple YAML Loader for wordpress

image

kevinkiel/wp-yaml-loader

Simple YAML Loader for wordpress

  • Tuesday, March 17, 2015
  • by kevinkiel
  • Repository
  • 2 Watchers
  • 0 Stars
  • 678 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 7 Versions
  • 2 % Grown

The README.md

wp-yaml-loader

Simple YAML config Loader for WordPress, (*1)

Security

Make sure that you place the config map outside the web root. If you discover any security related issues, please use the issue tracker., (*2)

Install

Via Composer, (*3)

$ composer require kevinkiel/wp-yaml-loader

Usage wp-config.php (PHP)

use KevinKiel\Yaml\Loader\YamlLoader;

$yaml = new YamlLoader;
$yaml->set_path( __DIR__ . '/../config' );
$yaml->load();

Config files

Place the config files outside the web root so nobody can read your yml files. Single string's int's and boolean will be defined define( 'DB_NAME', 'databasename' );., (*4)

config/config.yml
WP_ENV: development
#WP_ENV: acceptance
#WP_ENV: production
DB_NAME: databasename
DB_USER: username
DB_PASSWORD: password
DB_HOST: localhost
DB_PREFIX: wp_
DB_CHARSET: utf8
DB_COLLATE: ''
WP_DEBUG: false
WP_DEFAULT_THEME: thema
FS_METHOD: ssh2
DISALLOW_FILE_EDIT: true

(SALT) http://www.kevinkiel.nl/salt.php, (*5)

AUTH_KEY: 
SECURE_AUTH_KEY: 
LOGGED_IN_KEY: 
NONCE_KEY: 
AUTH_SALT: 
SECURE_AUTH_SALT: 
LOGGED_IN_SALT: 
NONCE_SALT: 

Custom config

If you're using custom config the data will be available as a global variable., (*6)

Custom example (YAML)., (*7)

twitter:
    oauth_access_token: [key]
    oauth_access_token_secret: [key]
    consumer_key: [key]
    consumer_secret: [key]    

Retrieve the custom config (PHP)., (*8)

global $config;
$twitter_auth = $config['twitter'];

/* oauth_access_token */
$oauth_access_token = $config['twitter']['oauth_access_token'];

OTAP

If you're using more then one environment. You can import / overwrite your config settings with your environment setting. Make sure you set your environment in config.yml with the 'WP_ENV' parameter., (*9)

config/config_development.yml
DB_NAME: development_databasename
DB_USER: development_username
DB_PASSWORD: development_password
WP_DEBUG: true
SAVEQUERIES: true
CONCATENATE_SCRIPTS: false
FS_METHOD: direct
EMPTY_TRASH_DAYS: 0
config/config_acceptance.yml
DB_NAME: acceptance_databasename
DB_USER: acceptance_username
DB_PASSWORD: acceptance_password
config/config_production.yml
DB_NAME: production_databasename
DB_USER: production_username
DB_PASSWORD: production_password

Credits

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

17/03 2015

dev-master

9999999-dev https://github.com/kevinkiel/wp-yaml-loader

Simple YAML Loader for wordpress

  Sources   Download

MIT

The Requires

 

by Kevin Kiel

wordpress wp yaml

17/03 2015

dev-develop

dev-develop https://github.com/kevinkiel/wp-yaml-loader

Simple YAML Loader for wordpress

  Sources   Download

MIT

The Requires

 

by Kevin Kiel

wordpress wp yaml

17/03 2015

1.0.5

1.0.5.0 https://github.com/kevinkiel/wp-yaml-loader

Simple YAML Loader for wordpress

  Sources   Download

MIT

The Requires

 

by Kevin Kiel

wordpress wp yaml

16/03 2015

1.0.4

1.0.4.0 https://github.com/kevinkiel/wp-yaml-loader

Simple YAML Loader for wordpress

  Sources   Download

MIT

The Requires

 

by Kevin Kiel

wordpress wp yaml

03/03 2015

1.0.3

1.0.3.0 https://github.com/kevinkiel/wp-yaml-loader

Simple YAML Loader for wordpress

  Sources   Download

MIT

The Requires

 

by Kevin Kiel

wordpress wp yaml

28/02 2015

1.0.2

1.0.2.0 https://github.com/kevinkiel/wp-yaml-loader

Simple YAML Loader for wordpress

  Sources   Download

MIT

The Requires

 

by Kevin Kiel

wordpress yaml

28/02 2015

1.0.1

1.0.1.0 https://github.com/kevinkiel/wp-yaml-loader

Simple YAML Loader for wordpress

  Sources   Download

MIT

The Requires

 

by Kevin Kiel

wordpress yaml