NAME
Contentment - A Mason/Perl-based content management system
DESCRIPTION
General configuration information and some general-purpose methods can be found in this module.
- $conf = Contentment->configuration
-
Reads the configuration files ETC_DIR/Contentment.defaults.conf and ETC_DIR/Contentment.conf.
- my $module = Contentment->security
-
Fetch the configured security module.
- my $context = Contentment->context
-
This method returns the singleton object for Contentment::Context.
- my $result = Contentment->run_plugin($plugin, @args)
-
This method loads the given plugin
$pluginand runs it with the given@argsand returns the result$result. The$pluginvariable is a complete package and method name. The method name is stripped and the package name is "used". Then, the method is called. - $result = Contentment->capture_streams($in, $out, $code, @args)
-
This is a helpful method for redirecting input and output for some bit of code. The
$inmust be a readable file handle and$outmust be a writable file handle. The$codeis a CODE reference to be run.First, the
STDINfile handle will be saved and then redirected to use$in. TheSTDOUTfile handle will be saved and then redirected to use$out.Next, the
$codewill be run in this environment and any additional arguments given will be based to the subroutine.Finally,
STDINandSTDOUTare restored and any result returned by$codeis returned. If an exception is raised while running$code, then the file handles are safely restored before this method rethrows the exception. - $cache = $context->cache($namespace)
-
Returns a Cache::Cache interface that can be used to cache generated output, etc.
- Contentment->call_hooks($dir, @args)
-
Run the appropriate generator on all files in /content/hooks/$dir and all subdirectories. The given
@argsare passed each time.The first hook will be given the input from the current
STDINand the last hook will generate output straight to the currentSTDOUT. In between, the previous hooks output toSTDOUTbecomes the next hooks input onSTDIN.Logs, but otherwise ignores, any errors that occur.
AUTHOR
Andrew Sterling Hanenkamp <hanenkamp@users.sourceforge.net>
COPYRIGHT AND LICENSE
Copyright 2005 Andrew Sterling Hanenkamp. All Rights Reserved.
Contentment is distributed and licensed under the same terms as Perl itself.