php class and examples for spark cloud interaction