public function getTransliterationMap($path, $alphabet)
    {
        // Valdate
        if (!in_array($alphabet, array(Settings::ALPHABET_CYR, Settings::ALPHABET_LAT))) {
            throw new \InvalidArgumentException(sprintf('Alphabet "%s" is not recognized.', $alphabet));
        }

        // Load form cache
        $map = $this->loadFromCache($path, $alphabet);
        if (null !== $map) {
            return $map;
        }

        // Load from file
        $map = $this->loadFromFile($path);

        // Store to cache
        $this->storeToCache($path, $map);

        return $this->loadFromCache($path, $alphabet);
    }
public function getTransliterationMap($path, $alphabet)
    {
        // Valdate
        if (!in_array($alphabet, array(Settings::ALPHABET_CYR, Settings::ALPHABET_LAT))) {
            throw new \InvalidArgumentException(sprintf('Alphabet "%s" is not recognized.', $alphabet));
        }

        // Load form cache
        $map = $this->loadFromCache($path, $alphabet);
        if (null !== $map) {
            return $map;
        }

        // Load from file
        $map = $this->loadFromFile($path);

        // Store to cache
        $this->storeToCache($path, $map);

        return $this->loadFromCache($path, $alphabet);
    }
public function getTransliterationMap ( $ path , $ alphabet ) { // Valdate if ( ! in_array ( $ alphabet , array ( Settings :: ALPHABET_CYR , Settings :: ALPHABET_LAT ) ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Alphabet "%s" is not recognized.' , $ alphabet ) ) ; } // Load form cache $ map = $ this -> loadFromCache ( $ path , $ alphabet ) ; if ( null !== $ map ) { return $ map ; } // Load from file $ map = $ this -> loadFromFile ( $ path ) ; // Store to cache $ this -> storeToCache ( $ path , $ map ) ; return $ this -> loadFromCache ( $ path , $ alphabet ) ; }
Get transliteration map.

@param  string $path     path to map file
@param  string $alphabet
@return array  map array
Get transliteration map .