     1: <?php
     2:
     3:     /**
     4:      * Single-file cache using JSON format to encode data
     5:      */
     6:     class Syllable_Cache_Json extends Syllable_Cache_FileAbstract {
     7:         protected function encode($array) {
     8:             return json_encode($array);
     9:         }
    10:
    11:         protected function decode($array) {
    12:             return json_decode($array, true);
    13:         }
    14:
    15:         protected function getFilename($language) {
    16:             return "syllable.{$language}.json";
    17:         }
    18:     }