Access to Configuration and Request Information
All this sounds horribly complicated, and,
to be honest, it is. But unless you plan to mess around with the guts
of Apache (which this book does not encourage you to do), all you
really need to know is that these structures exist and that your
module can get access to them at the appropriate moments. Each
function exported by a module gets access to the appropriate
structure to enable it to function. The appropriate structure depends
on the function, of course, but it is always either a
server_rec, the module’s
per-directory configuration structure (or two), or a
request_rec. As we saw earlier, if you have a
server_rec
, you can get access to your
per-server configuration, and if you have a
request_rec, you can get access to both your
per-server and your per-directory configurations.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access