A minimal state handler for PHP