add config getter, change fopen to file_put_contents