<commit_before>## Begin PostgreSQL manifest

if $postgresql_values == undef {
  $postgresql_values = hiera('postgresql', false)
}

class { 'postgresql::server':
  postgres_password => $postgresql_values['root_password'],
}

if is_hash($postgresql_values['databases']) and count($postgresql_values['databases']) > 0 {
  create_resources(postgresql_db, $postgresql_values['databases'])
}

define postgresql_db (
  $user,
  $password,
  $grant,
  $sql_file = false
) {
  postgresql::server::db { $name:
    user     => $user,
    password => $password,
    grant    => $grant
  }

  if $sql_file {
    $table = "${name}.*"

    exec{ "${name}-import":
      command     => "psql ${name} < ${sql_file}",
      logoutput   => true,
      refreshonly => $refresh,
      require     => Postgresql::Server::Db[$name],
      onlyif      => "test -f ${sql_file}"
    }
  }
}<commit_msg>Installing php5-pgsql if php installed and postgresql installed. Fixed #175<commit_after>## Begin PostgreSQL manifest

if $postgresql_values == undef {
  $postgresql_values = hiera('postgresql', false)
}

class { 'postgresql::server':
  postgres_password => $postgresql_values['root_password'],
}

if is_hash($postgresql_values['databases']) and count($postgresql_values['databases']) > 0 {
  create_resources(postgresql_db, $postgresql_values['databases'])
}

define postgresql_db (
  $user,
  $password,
  $grant,
  $sql_file = false
) {
  postgresql::server::db { $name:
    user     => $user,
    password => $password,
    grant    => $grant
  }

  if $sql_file {
    $table = "${name}.*"

    exec{ "${name}-import":
      command     => "psql ${name} < ${sql_file}",
      logoutput   => true,
      refreshonly => $refresh,
      require     => Postgresql::Server::Db[$name],
      onlyif      => "test -f ${sql_file}"
    }
  }
}

if $php_values == undef {
  $php_values = hiera('php', false)
}

if is_hash($php_values) {
  ensure_packages( ['php5-pgsql'] )
}
{'fraction_non_alphanumeric': 0.1640946502057613, 'fraction_numerical': 0.00360082304526749, 'mean_word_length': 3.630952380952381, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3113490', 'n_tokens_mistral': 697, 'n_tokens_neox': 679, 'n_words': 131}