PHP middleware library