Where to put some code that I want to run in every page request

Where to put some code that I want to run in every page request

by Jason Troy -
Number of replies: 1
Hi,

I'm a new developer to moodle and i'm still learning its architecture.

What's the best place to put some code that I want to run in every page request? (some custom logging / other systems integration)

Any sugestions, following the good practices of moodle?
Average of ratings: -
In reply to Jason Troy

Re: Where to put some code that I want to run in every page request

by Aaron Wells -
For stuff that gets printed to user, I'd put it in the theme. For strictly server-side things, like you're talking about, I might actually put that in config.php (see here and here for more info). If it's more than a couple of lines of code, I'd put it in a file in /local which I then call from config.php.

Cheers,
Aaron