PHP API for common file operations