PHP implementation of circuit breaker pattern.