SimpleSAML\Locale\Translate::readDictionaryFile PHP Method

readDictionaryFile() private method

Read a dictionary file.
private readDictionaryFile ( string $filename ) : array
$filename string The absolute path to the dictionary file.
return array An array holding all the translations in the file.
    private function readDictionaryFile($filename)
    {
        assert('is_string($filename)');
        \SimpleSAML\Logger::debug('Template: Reading [' . $filename . ']');
        $jsonFile = $filename . '.definition.json';
        if (file_exists($jsonFile)) {
            return $this->readDictionaryJSON($filename);
        }
        $phpFile = $filename . '.php';
        if (file_exists($phpFile)) {
            return $this->readDictionaryPHP($filename);
        }
        \SimpleSAML\Logger::error($_SERVER['PHP_SELF'] . ' - Template: Could not find dictionary file at [' . $filename . ']');
        return array();
    }