getList(); if(array_key_exists(argv(1), $languages)) { $lang = argv(1); $from_url = true; } else { $lang = \App::$language; if(! isset($lang)) $lang = 'en'; $from_url = false; } $this->lang = array('language' => $lang, 'from_url' => $from_url); } /** * Find the full path name of the file, given it's base path and * the language of the request. * * @param string $base_path The path of the file to find, relative to the * doc root path, and without the extension. */ private function find_help_file(string $base_path, string $lang): void { // Use local variable until we can use trait constants. $valid_file_ext = ['md', 'bb', 'html']; $base_path = "doc/{$lang}/${base_path}"; foreach ($valid_file_ext as $ext) { $path = "{$base_path}.{$ext}"; if (file_exists($path)) { $this->file_name = $path; $this->file_type = $ext; break; } } } }