PHP stack middleware for request localization