private static function load() { if (static::$phrases) { return; } $folder = FB_DATA_PATH . '/phrases'; static::$phrases = File::getArray($folder, config('language'), true); if (empty(static::$phrases)) { throw new Exception(sprintf('No phrases available to language %s on folder %s', config('language'), $folder)); } shuffle(static::$phrases); }
private static function load() { if (empty(static::$config)) { static::$config = File::getArray(FB_DATA_PATH . '/config', 'default', true); } }
public static function saveFriends(array $friends) { usort($friends, function ($a, $b) { return $a['name'] > $b['name'] ? 1 : -1; }); File::save(static::getFolder() . '/friends', $friends, true); }