Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aikar

aikar/example Secret

Created March 3, 2015 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aikar/a5035a2cfac8463aadc3 to your computer and use it in GitHub Desktop.
Save aikar/a5035a2cfac8463aadc3 to your computer and use it in GitHub Desktop.
/var/www/app/config.ini:
ini_manage.options_present:
- sections:
db:
host: localhost
user: {{ pillar['mysql_glpi_user'] }};
pass: {{ pillar['mysql_glpi_pass'] }};
db: {{ pillar['mysql_glpi_db'] }};
<?php
class DB extends DBmysql {
private $dbhost, $dbuser, $dbpassword, $dbdefault;
function __construct() {
$config = parse_ini_file("/var/www/app/config.ini");
$this->dbhost = $config['db']['host'];
$this->dbuser = $config['db']['user'];
$this->dbpassword = $config['db']['pass'];
$this->dbdefault = $config['db']['db'];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment