| PET:: | |
| Variables | |
| $BASEPATH | Base directory to this PET installation. |
| $DOCROOT | |
| $TEMPLATE | Template handling Object (of TT2). |
| $TCONFIG | Config for Template.pm’s “new” method. |
| $GCONF | The (default) values for global.conf |
| $GCONF_LASTMOD | Broken, but this shall hold the last modification time of global.conf |
| $SESSION | Session object (if any). |
| $DEBUG | Debug mode (broken!) |
| $UTIL | Holdig Util instances, e.g. |
| $Util | We use this for Template.pm. |
| $MAPPER | FIXME, this is not (yet) working. |
| $PAGECONF | per-page config data |
| $LOG | PET::Log objektum. |
| %VOLATILE | For caching data in-memory (refreshing automatically). |
| %BM | |
| $MODE | In which mode are we currently running (e.g. |
| $CACHE | If we hace a cache set up. |
| $CCTRL | Cache-control object init-ed once only. |
| $IFPROF | If profiling is switched in. |
| %FILTERS | Filters objects are stored here. |
| %Filter | Filters that have short names are stored here. |
| $PETEXT | |
| Functions | |
| new | Constructor method. |
| _init | Inits some default stuff. |
| _fetchGlobals | |
| _globalPostprocess | |
| _initAPI | Instanteniates the chosen (global.conf) actionmapper. |
| _fileUnchanged | |
| _start | |
| _getQuery () | |
| _fillQuery | |
| setHeader(%p) | Sets header(s). |
| addHeader(%p) | Adds header to output HTTP header. |
| self_url (%p) | Calls the same method of CGI::Simple if ‘full’ is given, otherwise uses REQUEST_URI (default). |
| setRC | |
| setContentType | |
| setAttr | |
| getAttr | |
| doRequest | |
| compilePetAndRun | |
| logPerf | |
| preprocessTemplate ($filename) | We run the template preprocess phase here. |
| getDefaultSubsts | |
| _startCookie | |
| getCookie | |
| cookieOnce ($key) | Set a cookie. |
| setCookie (%p) | A method to create (and “emit’) a cookie. |
| deleteCookie | Deletes the name cookie. |
| _initcache () | If there is a cache/class, then we init it! |
| apck ($select, $pagekey) | Auto Page Cache Key. |
| toCache | |
| fromCache | |
| getRealUrl | |
| getGconf | |
| getConf ($path) | Get a config value from global.conf. |
| setConf | |
| _getLastMod() | Returns the “last modification time” (mtime) of the given file. |
| getSession() | Shortcut to return a given Session value (if sessions are enabled). |
| setSession() | Shortcut to access the setter method of the implementing Session object. |
| getSessionId | |
| invalidateSession | |
| getSessionObject | Returns the Session object, if any. |
| getBASEPATH() | This is an accessor, that returns the $BASEPATH value. |
| getLog() | This is an accessor, that returns the $LOG value, which is a PET::Log |
| *getUtil* | Returns the already instanteniated PET::Dispatcher object. |
| getUtil | |
| getUtilHash | |
| getPageKey() | Returns the current key for this page (generated from the URL). |
| reloadModule | (Re)loads a (Perl) module using “require”. |
| getCACHE | |
| get500 | |
| skipOn ($string) | Cache-control, skipon tag. |
| servePetAdmin () |
sub _init
Inits some default stuff. Actually lots of default stuff... very expensive, only called at init time. This: set $DOCROOT, calls _fetchGlobals, sets <$FILTERS>, creates $TEMPLATE, creates $UTIL, creates $SESSION, calls <_startCache>, and inits the API (if any)
sub preprocessTemplate
We run the template preprocess phase here. general/template/filters stores the list of modules (defined by their name) here. They are initied at _init(). The order is important! We check for .pet chanes -- if they change, we re-run the filter, otherwise they are considered unchanged.
Returns: a filename (name of the new, generated file).
This mechanism is used to change .pet files “on the fly”. This is used for example by multilingual modules to generate the localized version of the given template.
sub setCookie
A method to create (and “emit’) a cookie. Often called from external modules, or from the template directly. Uses CGI::Simple::Cookie almost directly, so most parameters are identical to the parameters passed to the new() method of the above module.
The cookie string is added to the headers, and are set when the page is emitted (even if it is a redirect).
| name | name of the cookie |
| key [DEPRECATED!] | or-ed with “name” |
| value | value to set (can be a hashref or a string!) |
| domain | domain of the cookie |
| expires | expiration (see CGI::Simple::Cookie for syntax!) FIXME: Path should be set, too... |
Note that we do not do any real syntax/semantic checking here.
sub getBASEPATH
This is an accessor, that returns the $BASEPATH value.
sub getLog
This is an accessor, that returns the $LOG value, which is a PET::Log
sub reloadModule
(Re)loads a (Perl) module using “require”.
We use this to load modules at runtime (so BEGIN blocks are not run). The module name is passed as a string. When in debug mode, reloadModule actually reloads the named module (first deleting it from %INC). Returns: 1 -> (re)loaded, 0 -> already loaded, -1 -> compilation error Compilation error is only logged at the error_log. The return value basically shows if we have to re-init the module or not.
sub skipOn
Cache-control, skipon tag. This string is used to determine if we should skip caching for the named page. E.g. a main page of a site is cached, except for when a “login” button is pressed. The format is: “$key.$subkey”, e.g. ‘form.login’ FIXME : this should DWIM, now it is rather plain...
Base directory to this PET installation.
my $BASEPATH
my $DOCROOT
Template handling Object (of TT2).
my $TEMPLATE
Config for Template.pm’s “new” method.
my $TCONFIG
The (default) values for global.conf
my $GCONF
Broken, but this shall hold the last modification time of global.conf
my $GCONF_LASTMOD
Session object (if any).
my $SESSION
Debug mode (broken!)
our $DEBUG
Holdig Util instances, e.g.
our $UTIL
We use this for Template.pm.
my $Util
FIXME, this is not (yet) working.
our $MAPPER
per-page config data
our $PAGECONF
PET::Log objektum.
my $LOG
For caching data in-memory (refreshing automatically).
our %VOLATILE
our %BM
In which mode are we currently running (e.g.
our $MODE
If we hace a cache set up.
our $CACHE
Cache-control object init-ed once only.
our $CCTRL
If profiling is switched in.
my $IFPROF
Filters objects are stored here.
my %FILTERS
Filters that have short names are stored here.
my %Filter
my $PETEXT
Constructor method.
sub new
Inits some default stuff.
sub _init
sub _fetchGlobals
sub _globalPostprocess
Instanteniates the chosen (global.conf) actionmapper.
sub _initAPI
sub _fileUnchanged
sub _start
sub _fillQuery
Sets header(s).
sub setHeader
Adds header to output HTTP header.
sub addHeader
Calls the same method of CGI::Simple if ‘full’ is given, otherwise uses REQUEST_URI (default).
sub self_url
sub setRC
sub setContentType
sub setAttr
sub getAttr
sub doRequest
sub compilePetAndRun
sub logPerf
We run the template preprocess phase here.
sub preprocessTemplate
sub getDefaultSubsts
sub _startCookie
sub getCookie
Set a cookie.
sub cookieOnce
A method to create (and “emit’) a cookie.
sub setCookie
Deletes the name cookie.
sub deleteCookie
If there is a cache/class, then we init it!
sub _initcache
Auto Page Cache Key.
sub apck
sub toCache
sub fromCache
sub getRealUrl
sub getGconf
Get a config value from global.conf.
sub getConf
sub setConf
Returns the “last modification time” (mtime) of the given file.
sub _getLastMod
Shortcut to return a given Session value (if sessions are enabled).
sub getSession
Shortcut to access the setter method of the implementing Session object.
sub setSession
sub getSessionId
sub invalidateSession
Returns the Session object, if any.
sub getSessionObject
This is an accessor, that returns the $BASEPATH value.
sub getBASEPATH
This is an accessor, that returns the $LOG value, which is a PET::Log
sub getLog
sub getUtil
sub getUtilHash
Returns the current key for this page (generated from the URL).
sub getPageKey
(Re)loads a (Perl) module using “require”.
sub reloadModule
sub getCACHE
sub get500
Cache-control, skipon tag.
sub skipOn
sub servePetAdmin