It took me some searches, however I was able to find the answer ( available here ) related to CodeIgniter.
A small modification made it work for me (with Slim), and I believe that other PHP routers and frameworks will have about the same solution:
if (extension_loaded ('newrelic')) { newrelic_name_transaction($_SERVER['REQUEST_URI']); }
Edit: to avoid including any GET parameters, use this in the second line:
newrelic_name_transaction(current(explode('?', $_SERVER['REQUEST_URI'])))
Note. Emerson's answer, where he recommends using a route pattern, is much better than using a literal URL if you are using Slim.
Brian
source share