Codeigniter generalize library