App as error handler, config writer php