Ejemplo n.º 1
0
 /**
  * Constructor
  *
  * Prevent creating instances of this class by making the contructor private
  *
  * @param  array  An optional array with configuration options.
  */
 private final function __construct($config = array())
 {
     //store the path
     $this->_path = dirname(__FILE__);
     //instantiate koowa
     Koowa::getInstance(array('cache_prefix' => $config['cache_prefix'], 'cache_enabled' => $config['cache_enabled']));
     //if caching is not enabled then reset the apc cache to
     //to prevent corrupt identifier
     if (!$config['cache_enabled']) {
         clean_apc_with_prefix($config['cache_prefix']);
     }
     require_once dirname(__FILE__) . '/loader/adapter/anahita.php';
     KLoader::addAdapter(new AnLoaderAdapterAnahita(array('basepath' => dirname(__FILE__))));
     KLoader::addAdapter(new AnLoaderAdapterDefault(array('basepath' => JPATH_LIBRARIES . '/default')));
     AnServiceClass::getInstance();
     KServiceIdentifier::addLocator(new AnServiceLocatorAnahita());
     KServiceIdentifier::addLocator(new AnServiceLocatorRepository());
     //register an empty path for the application
     //a workaround to remove the applicaiton path from an identifier
     KServiceIdentifier::setApplication('', '');
     //create a central event dispatcher
     KService::set('anahita:event.dispatcher', KService::get('koowa:event.dispatcher'));
 }