While not strictly necessary, it is very much advised that you read this document about the internals and design of PET.
| PET Explained | While not strictly necessary, it is very much advised that you read this document about the internals and design of PET. |
| The big picture | |
| In details - operation | The main module of PET is PET::Dispatcher. |
| In details - modules | Under construction |
These are the basics. To the user everything is transparent. There are obviously many more things going on...
Note : you might skip the remaining part of this document at first read.
The main module of PET is PET::Dispatcher. It calls everything else. However, it assumes that it is run in a “CGI-like, persistent environment”, e.g. under FastCGI. (It can also be run from CLI or even in CGI mode, but those are corner cases.) Different kinds of “wrappers” are provided under <PET::RUN>, which interface PET::Dispatcher to your environment.
When started, PET::Dispatcher reads global.conf, its main configuration file, and sets up its internals : load modules, filters, defines database connections, and so on. Then the PET server waits on incoming requests. As PET is supposed to be run in a persistent environment, it is a good idea to load static data at this point. More precisely:
Your webserver is configured so that it sends certain incoming requests to PET. Usually this simply means that any URL ending with “.pet” are sent to the PET server. The extension can be overriden, e.g. to use “.asp” or whatnot.
When a request is received, the PET server begins a request. It sets up environment variables (e.g. populates the $Form and $Query variables, initing the session, etc.) Please note that everything in PET is configurable to make your life easier -- however, because of this, we can hardly say what PET does : it does what it is configured to do.
After initing everything, PET serves the request.