Introduction
Krai Framework comes bundled with a handful of core modules and some extra modules to provide commonly requested functionality. The sections below describe both of these sorts.
Core
The Krai Framework Core is comprised of the modules required to execute requests received from the web server. These cannot be turned off in the framework configuration file.
Krai
This is the core class of the framework. It handles setup and dispatching to the other framework pieces. It also provides wrappers around some of the extra modules so that applications do not need to check whether or not those have been loaded.
Additionally, this class implements class autoload functionality for the framework's application-level naming scheme by means of spl_autoload_register. This allows application developers to still employ autoloading without necessarily killing the framework autoloader.
Router
Krai_Router is responsible for parsing requests to the application and dispatching to a Krai_Module according to the configuration in the routes configuration file. It also generates urls for links based on where the application wants the link to target (based on module name, action name, and additional parameters).
Module
Krai_Module is responsible for handling requests passed along from the Router, as well as calling and managing Krai_Module_Action executions. Furthermore, Krai_Module handles redirects called from a Krai_Module_Action.
Action
Krai_Module_Action is the base class for all application actions. An action is the bits of code that actually handle individual requests -- validating, processing, and displaying data. The Krai_Module_action class manages rendering of data and provides a structured way to organize execution and error handling.
Struct
Krai_Struct is a class that emulates some of the functionality of the "struct" types of other languages. It enforces only a limited set of allowed properties which are configurable when extending from the class. Additionally, it enforces the types of values assigned to those properties.
Lib
Krai Framework comes with a couple bundled libraries. First, Nakor is an input scrubber, which is commonly only used at runtime by the Krai class to clean the $_POST and $_GET arrays. Second, Spyc is a YAML parser responsible for converting the framework configuration file into PHP data structures.
Extra
The Krai Framework also includes modules not necessarily required for every request but which are typically quite useful. These modules can be disabled in the framework configuration file.
Db
Krai_Db is a database abstraction handler. It provides some abstraction from MySQL through the MySQLi interface, or to a number of other databases (and also mysql) through a PDO interface. While the PDO interface is still a bit unstable, it has been tested with MySQL and works just fine.
Krai_Mail is a wrapper around the PEAR Mail class (which is therefore required to use this module). It abstracts mailing yet further than Mail does.
Log
Krai_Log is an application-level logging mechanism. It is servicable, but not very easily configurable at the moment. This will be improved in the 1.1 line hopefully.
Markup
Krai_Markup is a collection of markup generators. This may not stay around for long, since it seems to be against the lightweight spirit of the framework. However, for now it provides generators for <script> tags for javascript files and <link> tags for css stylesheets.
Cache
Krai_Cache is a planned module to provide both full and partial page caching. It is still in development.
Content Updated: Wed, Jul. 23rd 12:37 PM by Greg McWhirter (gsmcwhirter)

