Rewriting mysqli* functions