You are here

public function ShellManager::getInstalledLocales in FillPDF 8.4

Same name and namespace in other branches
  1. 5.0.x src/ShellManager.php \Drupal\fillpdf\ShellManager::getInstalledLocales()

Gets the list of locales installed on the server.

Return value

string[] Associative array of installed locales as returned by 'locale -a' on *nix systems, keyed by itself. Will return an empty array on Windows servers.

Overrides ShellManagerInterface::getInstalledLocales

File

src/ShellManager.php, line 49

Class

ShellManager
Manage execution of shell commands.

Namespace

Drupal\fillpdf

Code

public function getInstalledLocales() {
  if ($this
    ->isWindows()) {
    return [];
  }
  $output = [];
  $status = NULL;
  exec("locale -a", $output, $status);
  return array_combine($output, $output);
}