In addition to the above objects that are guaranteed to exist after initialization has happened, the following can be retrieved if they have been explicitly added to the Context after initialization via setcontext().
These objects are usually created and attached by the OpenXPKI Server initialization procedure in order to make the objects available globally.
o api o server
Allows to retrieve an object reference for the specified name. If called before initialization has happened (see create() function) calling CTX() yields an exception. CTX() returns the associated object in the global context.
use OpenXPKI::Server::Context qw( CTX ); my $config = CTX(xml_config);
It is also possible to call CTX() in array context to obtain multiple context entries at once:
my ($config, $log, $dbi) = CTX(xml_config, log, dbi_backend);
Allows to set additional globally available Context information after the Context has been initialized via create().
To prevent abuse (storing arbitrary stuff globally) the Context module only allows to set Context entries that are allowed explicitly. Only the keys mentioned above are accepted, trying to set an unsupported Context object yields an exception.
Check if the requested entry is available from the context.
Delete the recorded session from the context. Used during server startup where we start with a mock session and need a real one later.
|perl v5.20.3||OPENXPKI::SERVER::CONTEXT (3)||2016-04-03|