/**
  * Load all configuration application and module level handlers.
  *
  * @throws     <b>AgaviConfigurationException</b> If a configuration related
  *                                                error occurs.
  *
  * @author     Sean Kerr <*****@*****.**>
  * @since      0.9.0
  */
 protected static function loadConfigHandlers()
 {
     if (self::$handlers !== null) {
         return;
     } else {
         self::$handlers = array();
     }
     // some checks first
     if (!defined('LIBXML_DOTTED_VERSION') || !AgaviConfig::get('core.ignore_broken_libxml', false) && !version_compare(LIBXML_DOTTED_VERSION, '2.6.16', 'gt')) {
         throw new AgaviException("A libxml version greater than 2.6.16 is highly recommended. With version 2.6.16 and possibly later releases, validation of XML configuration files will not work and Form Population Filter will eventually fail randomly on some documents due to *severe bugs* in older libxml releases (2.6.16 was released in November 2004, so it is really getting time to update).\n\nIf you still would like to try your luck, disable this message by doing\nAgaviConfig::set('core.ignore_broken_libxml', true);\nand\nAgaviConfig::set('core.skip_config_validation', true);\nbefore calling\nAgavi::bootstrap();\nin index.php (app/config.php is not the right place for this).\n\nBut be advised that you *will* run into segfaults and other sad situations eventually, so what you should really do is upgrade your libxml install.");
     }
     $agaviDir = AgaviConfig::get('core.agavi_dir');
     // :NOTE: fgilcher, 2008-12-03
     // we need this method reentry safe for unit testing
     // sorry for the testing code in the class, but I don't have
     // any other idea to solve the issue
     if (!self::$filesIncluded) {
         // since we only need the parser and handlers when the config is not cached
         // it is sufficient to include them at this stage
         require_once $agaviDir . '/config/AgaviILegacyConfigHandler.interface.php';
         require_once $agaviDir . '/config/AgaviIXmlConfigHandler.interface.php';
         require_once $agaviDir . '/config/AgaviBaseConfigHandler.class.php';
         require_once $agaviDir . '/config/AgaviConfigHandler.class.php';
         require_once $agaviDir . '/config/AgaviXmlConfigHandler.class.php';
         require_once $agaviDir . '/config/AgaviAutoloadConfigHandler.class.php';
         require_once $agaviDir . '/config/AgaviConfigHandlersConfigHandler.class.php';
         require_once $agaviDir . '/config/AgaviConfigValueHolder.class.php';
         require_once $agaviDir . '/config/AgaviConfigParser.class.php';
         require_once $agaviDir . '/config/AgaviXmlConfigParser.class.php';
         // extended DOM* classes
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomAttr.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomCharacterData.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomComment.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomDocument.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomDocumentFragment.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomDocumentType.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomElement.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomEntity.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomEntityReference.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomNode.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomNotation.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomProcessingInstruction.class.php';
         require_once $agaviDir . '/config/util/dom/AgaviXmlConfigDomText.class.php';
         // schematron processor
         require_once $agaviDir . '/config/util/schematron/AgaviXmlConfigSchematronProcessor.class.php';
         // extended XSL* classes
         if (!AgaviConfig::get('core.skip_config_transformations', false)) {
             if (!extension_loaded('xsl')) {
                 throw new AgaviConfigurationException("The XSL extension for PHP is used by Agavi for performing transformations in the configuration system; this may be disabled by setting\nAgaviConfig::set('core.skip_config_transformations', true);\nbefore calling\nAgavi::bootstrap();\nin index.php (app/config.php is not the right place for this).\n\nAs a result, you *will* have to use the latest configuration file formats and namespaces as backwards compatibility is implemented through XSLT. Also, certain additional configuration file validations implemented via Schematron will not be performed.");
             }
             // kill a bunch of kittens thanks to http://trac.agavi.org/ticket/1038...
             $hopeless = version_compare(PHP_VERSION, '5.2.9', '<');
             if ($hopeless) {
                 $crapfest = error_reporting(error_reporting() & ~E_STRICT);
             }
             require $agaviDir . '/config/util/xsl/AgaviXmlConfigXsltProcessor.class.php';
             if ($hopeless) {
                 // ... and resurrect them (breathe, kitty, breathe, damnit!)
                 error_reporting($crapfest);
             }
         }
         self::$filesIncluded = true;
     }
     // manually create our config_handlers.xml handler
     self::$handlers['config_handlers.xml'] = array('class' => 'AgaviConfigHandlersConfigHandler', 'parameters' => array(), 'transformations' => array(AgaviXmlConfigParser::STAGE_SINGLE => array($agaviDir . '/config/xsl/config_handlers.xsl'), AgaviXmlConfigParser::STAGE_COMPILATION => array()), 'validations' => array(AgaviXmlConfigParser::STAGE_SINGLE => array(AgaviXmlConfigParser::STEP_TRANSFORMATIONS_BEFORE => array(), AgaviXmlConfigParser::STEP_TRANSFORMATIONS_AFTER => array(AgaviXmlConfigParser::VALIDATION_TYPE_XMLSCHEMA => array($agaviDir . '/config/xsd/config_handlers.xsd'), AgaviXmlConfigParser::VALIDATION_TYPE_SCHEMATRON => array($agaviDir . '/config/sch/config_handlers.sch'))), AgaviXmlConfigParser::STAGE_COMPILATION => array(AgaviXmlConfigParser::STEP_TRANSFORMATIONS_BEFORE => array(), AgaviXmlConfigParser::STEP_TRANSFORMATIONS_AFTER => array())));
     $cfg = AgaviConfig::get('core.config_dir') . '/config_handlers.xml';
     if (!is_readable($cfg)) {
         $cfg = AgaviConfig::get('core.system_config_dir') . '/config_handlers.xml';
     }
     // application configuration handlers
     self::loadConfigHandlersFile($cfg);
 }