Exemplo n.º 1
0
 public function getServerErrors()
 {
     $errors = array();
     if (!class_exists('mysqli')) {
         $errors[] = JText::_("We're sorry but your server isn't configured with the MySQLi database driver. Please\n\t\t    contact your host and ask them to enable MySQLi for your server.");
     }
     if (version_compare(phpversion(), '5.3', '<')) {
         $errors[] = sprintf(JText::_("EXTman requires PHP 5.3 or later. Your server is running PHP %s."), phpversion());
     }
     if (!function_exists('token_get_all')) {
         $errors[] = 'PHP tokenizer extension must be enabled by your host.';
     }
     if (version_compare(JFactory::getDBO()->getVersion(), '5.0.41', '<')) {
         $errors[] = sprintf(JText::_("EXTman requires MySQL 5.0.41 or later. Your server is running MySQL %s."), JFactory::getDBO()->getVersion());
     }
     // Check a bunch of Ohanah v2 files to see if it is installed
     if (file_exists(JPATH_ADMINISTRATOR . '/components/com_ohanah/controllers/event.php') || file_exists(JPATH_SITE . '/components/com_ohanah/dispatcher.php') || file_exists(JPATH_SITE . '/components/com_ohanah/controllers/event.php')) {
         $errors[] = sprintf("You have the Ohanah event management extension installed.\n            Ohanah works with an older version of our Nooku framework, so updating EXTman now would break your site.\n            Installation is aborting. For more information please read our detailed explanation <a target=\"_blank\" href=\"%s\">here</a>.", 'http://www.joomlatools.com/framework-known-issues');
     }
     if (class_exists('Koowa') && (!method_exists('Koowa', 'getInstance') || version_compare(Koowa::getInstance()->getVersion(), '1', '<'))) {
         $errors[] = sprintf(JText::_("Your site has an older version of our library already installed. Installation\n\t\t\t is aborting to prevent creating conflicts with other extensions."));
     }
     //Some hosts that specialize on Joomla are known to lock permissions to the libraries folder
     if (!is_writable(JPATH_LIBRARIES)) {
         $errors[] = sprintf(JText::_("The <em title=\"%s\">libraries</em> folder needs to be writable in order for\n\t\t    EXTman to install correctly."), JPATH_LIBRARIES);
     }
     if (count($errors) === 0 && $this->checkDatabaseType() === false) {
         $link = JRoute::_('index.php?option=com_config');
         $errors[] = "In order to use Joomlatools extensions, your database type in Global Configuration should be set\n\t\t\tto <strong>MySQLi</strong>. Please go to <a href=\"{$link}\">Global Configuration</a> and in the 'Server' tab\n\t\t\tchange your Database Type to <strong>MySQLi</strong>.";
     }
     return $errors;
 }
Exemplo n.º 2
0
 public function __construct($subject, $config = array())
 {
     // Turn off E_STRICT errors for now
     error_reporting(error_reporting() & ~E_STRICT);
     // Check if database type is MySQLi
     if (JFactory::getApplication()->getCfg('dbtype') != 'mysqli') {
         if (JFactory::getApplication()->getName() === 'administrator') {
             $string = version_compare(JVERSION, '1.6', '<') ? 'mysqli' : 'MySQLi';
             $link = JRoute::_('index.php?option=com_config');
             $error = 'In order to use Joomlatools framework, your database type in Global Configuration should be set to <strong>%1$s</strong>. Please go to <a href="%2$s">Global Configuration</a> and in the \'Server\' tab change your Database Type to <strong>%1$s</strong>.';
             JError::raiseWarning(0, sprintf(JText::_($error), $string, $link));
         }
         return;
     }
     // Set pcre.backtrack_limit to a larger value
     // See: https://bugs.php.net/bug.php?id=40846
     if (version_compare(PHP_VERSION, '5.3.6', '<=') && @ini_get('pcre.backtrack_limit') < 1000000) {
         @ini_set('pcre.backtrack_limit', 1000000);
     }
     //Set constants
     define('KDEBUG', JDEBUG);
     //Set path definitions
     define('JPATH_FILES', JPATH_ROOT);
     define('JPATH_IMAGES', JPATH_ROOT . DIRECTORY_SEPARATOR . 'images');
     //Set exception handler
     set_exception_handler(array($this, 'exceptionHandler'));
     // Koowa : setup
     require_once JPATH_LIBRARIES . '/koowa/koowa.php';
     Koowa::getInstance(array('cache_prefix' => md5(JFactory::getApplication()->getCfg('secret')) . '-cache-koowa', 'cache_enabled' => false));
     KLoader::addAdapter(new KLoaderAdapterModule(array('basepath' => JPATH_BASE)));
     KLoader::addAdapter(new KLoaderAdapterPlugin(array('basepath' => JPATH_ROOT)));
     KLoader::addAdapter(new KLoaderAdapterComponent(array('basepath' => JPATH_BASE)));
     KServiceIdentifier::addLocator(KService::get('koowa:service.locator.module'));
     KServiceIdentifier::addLocator(KService::get('koowa:service.locator.plugin'));
     KServiceIdentifier::addLocator(KService::get('koowa:service.locator.component'));
     KServiceIdentifier::setApplication('site', JPATH_SITE);
     KServiceIdentifier::setApplication('admin', JPATH_ADMINISTRATOR);
     KService::setAlias('koowa:database.adapter.mysqli', 'com://admin/default.database.adapter.mysqli');
     KService::setAlias('translator', 'com:default.translator');
     //Setup the request
     if (JFactory::getApplication()->getName() !== 'site') {
         KRequest::root(str_replace('/' . JFactory::getApplication()->getName(), '', KRequest::base()));
     }
     //Load the koowa plugins
     JPluginHelper::importPlugin('koowa', null, true);
     //Bugfix : Set offset accoording to user's timezone
     if (!JFactory::getUser()->guest) {
         if ($offset = JFactory::getUser()->getParam('timezone')) {
             if (version_compare(JVERSION, '3.0', '>=')) {
                 JFactory::getConfig()->set('offset', $offset);
             } else {
                 JFactory::getConfig()->setValue('config.offset', $offset);
             }
         }
     }
     // Load language files for the framework
     KService::get('com:default.translator')->loadLanguageFiles();
     parent::__construct($subject, $config);
 }
Exemplo n.º 3
0
 public function getPropertyFullpath()
 {
     $result = $this->getProperty('path');
     // Prepend with site root if it is a relative path
     if (!preg_match('#^(?:[a-z]\\:|~*/)#i', $result)) {
         $result = Koowa::getInstance()->getRootPath() . '/' . $result;
     }
     $result = rtrim(str_replace('\\', '/', $result), '\\');
     return $result;
 }
Exemplo n.º 4
0
 public function getTrackingInfo($extension)
 {
     $version = new JVersion();
     $server = @php_uname('s') . ' ' . @php_uname('r');
     // php_uname is disabled
     if (empty($server)) {
         $server = 'Unknown';
     }
     $info = array('Product' => $extension->name, 'Version' => $extension->version, 'Joomla' => $this->_extractVersionInfo($version->getShortVersion()), 'Koowa' => class_exists('Koowa') && method_exists('Koowa', 'getInstance') ? Koowa::getInstance()->getVersion() : 0, 'PHP' => $this->_extractVersionInfo(phpversion()), 'Database' => $this->_extractVersionInfo(JFactory::getDBO()->getVersion()), 'Web Server' => @$_SERVER['SERVER_SOFTWARE'], 'Web Server OS' => $server, 'Joomla Language' => JFactory::getLanguage()->getName());
     return $info;
 }
Exemplo n.º 5
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $this->check($input, $output);
     require_once Util::buildTargetPath('libraries/koowa/libraries/koowa.php', $this->target_dir);
     require_once Util::buildTargetPath('configuration.php', $this->target_dir);
     \Koowa::getInstance();
     $config = new \JConfig();
     $secret = $config->secret;
     $user = $input->getArgument('username');
     $token = \KObjectManager::getInstance()->getObject('http.token')->setSubject($user)->sign($secret);
     $output->writeln($token);
 }
Exemplo n.º 6
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'));
 }
 public function getServerErrors()
 {
     $errors = array();
     if (extension_loaded('suhosin')) {
         $prev = @ini_get('suhosin.executor.include.whitelist');
         $attempt = 'tmpl://' . ($prev ? ', ' . $prev : '');
         //Attempt setting the whitelist value
         @ini_set('suhosin.executor.include.whitelist', $attempt);
         //Checking if the whitelist is ok
         if (!@ini_get('suhosin.executor.include.whitelist') || strpos(@ini_get('suhosin.executor.include.whitelist'), 'tmpl://') === false) {
             $errors[] = sprintf(JText::_('The install failed because your server has Suhosin loaded, but it\'s not configured correctly. Please follow <a href="%s" target="_blank">this</a> tutorial before you reinstall.'), 'http://www.joomlatools.com/framework-known-issues');
         }
     }
     if (!class_exists('mysqli')) {
         $errors[] = JText::_("We're sorry but your server isn't configured with the MySQLi database driver. Please contact your host and ask them to enable MySQLi for your server.");
     }
     if (version_compare(phpversion(), '5.2', '<')) {
         $errors[] = sprintf(JText::_("EXTman requires PHP 5.2 or later. Your server is running PHP %s."), phpversion());
     }
     if (version_compare(JFactory::getDBO()->getVersion(), '5.0.41', '<')) {
         $errors[] = sprintf(JText::_("EXTman requires MySQL 5.0.41 or later. Your server is running MySQL %s."), JFactory::getDBO()->getVersion());
     }
     if (class_exists('Koowa') && (!method_exists('Koowa', 'getInstance') || version_compare(Koowa::getInstance()->getVersion(), '12', '<'))) {
         $errors[] = sprintf(JText::_("Your site has an older version of our library already installed. Installation is aborting to prevent creating conflicts with other extensions."));
     }
     //Some hosts that specialize on Joomla are known to lock permissions to the libraries folder
     if (!is_writable(JPATH_LIBRARIES)) {
         $errors[] = sprintf(JText::_("The <em title=\"%s\">libraries</em> folder needs to be writable in order for EXTman to install correctly."), JPATH_LIBRARIES);
     }
     if (count($errors) === 0 && $this->checkDatabaseType() === false) {
         $string = $this->getVersion() === '1.5' ? 'mysqli' : 'MySQLi';
         $link = JRoute::_('index.php?option=com_config');
         $errors[] = "In order to use Joomlatools extensions, your database type in Global Configuration should be set to <strong>{$string}</strong>. Please go to <a href=\"{$link}\">Global Configuration</a> and in the 'Server' tab change your Database Type to <strong>{$string}</strong>.";
     }
     return $errors;
 }
Exemplo n.º 8
0
 /**
  * Removes Joomla root from a filename replacing them with the plain text equivalents.
  *
  * Useful for debugging when you want to display a shorter path.
  *
  * @param   array   $config An optional array with configuration options
  * @return  string  Html
  */
 public function path($config = array())
 {
     $config = new KObjectConfigJson($config);
     $config->append(array('file' => '', 'line' => '', 'root' => Koowa::getInstance()->getRootPath(), 'editor' => $this->_editor));
     $html = $config->file;
     if (strpos($config->file, $config->root) === 0) {
         $html = '...' . DIRECTORY_SEPARATOR . trim(substr($config->file, strlen($config->root)), DIRECTORY_SEPARATOR);
     }
     if ($config->editor && isset($this->_editors[$config->editor])) {
         $editor = $this->_editors[$config->editor];
         foreach ($this->_getSharedPaths() as $guest => $host) {
             if (substr($config->file, 0, strlen($guest)) == $guest) {
                 $config->file = str_replace($guest, $host, $config->file);
             }
         }
         if (is_callable($editor)) {
             $editor = call_user_func($editor, $config->file, $config->line);
         }
         $editor = str_replace("%line", $config->line, $editor);
         $editor = str_replace("%file", $config->file, $editor);
         $html = '<a href="' . $editor . '" title="' . $html . '">' . $html . '</a>';
     }
     return $html;
 }
Exemplo n.º 9
0
    }
}
// System includes
require_once JPATH_LIBRARIES . '/joomla/import.php';
// Joomla : setup
jimport('joomla.application.menu');
jimport('joomla.user.user');
jimport('joomla.environment.uri');
jimport('joomla.html.html');
jimport('joomla.html.parameter');
jimport('joomla.utilities.utility');
jimport('joomla.event.event');
jimport('joomla.event.dispatcher');
jimport('joomla.language.language');
jimport('joomla.utilities.string');
jimport('joomla.plugin.helper');
// Koowa : setup
require_once JPATH_CONFIGURATION . '/configuration.php';
$config = new JConfig();
require_once JPATH_LIBRARIES . '/koowa/koowa.php';
Koowa::getInstance(array('cache_prefix' => md5($config->secret) . '-cache-koowa', 'cache_enabled' => $config->caching));
unset($config);
KLoader::addAdapter(new KLoaderAdapterModule(array('basepath' => JPATH_BASE)));
KLoader::addAdapter(new KLoaderAdapterPlugin(array('basepath' => JPATH_ROOT)));
KLoader::addAdapter(new KLoaderAdapterComponent(array('basepath' => JPATH_BASE)));
KServiceIdentifier::addLocator(KService::get('koowa:service.locator.module'));
KServiceIdentifier::addLocator(KService::get('koowa:service.locator.plugin'));
KServiceIdentifier::addLocator(KService::get('koowa:service.locator.component'));
KServiceIdentifier::setApplication('site', JPATH_SITE);
KServiceIdentifier::setApplication('admin', JPATH_ADMINISTRATOR);
KService::setAlias('koowa:database.adapter.mysqli', 'com://admin/default.database.adapter.mysqli');
Exemplo n.º 10
0
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
error_reporting(E_ALL);
ini_set('magic_quotes_runtime', 0);
//Installation check, and check on removal of the install directory.
if (file_exists(JPATH_CONFIGURATION . '/configuration.php') && filesize(JPATH_CONFIGURATION . '/configuration.php') > 10 && !file_exists(JPATH_INSTALLATION . '/index.php')) {
    header('Location: ../index.php');
    exit;
}
// Joomla : setup
require_once JPATH_LIBRARIES . '/joomla/import.php';
jimport('joomla.database.table');
jimport('joomla.user.user');
jimport('joomla.environment.uri');
jimport('joomla.user.user');
jimport('joomla.html.parameter');
jimport('joomla.utilities.utility');
jimport('joomla.language.language');
jimport('joomla.utilities.string');
define('JPATH_INCLUDES', dirname(__FILE__));
// Koowa : setup
require_once JPATH_LIBRARIES . '/koowa/koowa.php';
Koowa::getInstance();
KLoader::addAdapter(new KLoaderAdapterComponent(array('basepath' => JPATH_BASE)));
KServiceIdentifier::addLocator(KService::get('koowa:service.locator.component'));
KServiceIdentifier::setApplication('site', JPATH_SITE);
KServiceIdentifier::setApplication('admin', JPATH_ADMINISTRATOR);
Exemplo n.º 11
0
 public function __construct($subject, $config = array())
 {
     // Turn off E_STRICT errors for now
     error_reporting(error_reporting() & ~E_STRICT);
     // Command line fixes for Joomla
     if (PHP_SAPI === 'cli') {
         if (!isset($_SERVER['HTTP_HOST'])) {
             $_SERVER['HTTP_HOST'] = '';
         }
         if (!isset($_SERVER['REQUEST_METHOD'])) {
             $_SERVER['REQUEST_METHOD'] = '';
         }
     }
     // Check if Koowa is active
     if (JFactory::getApplication()->getCfg('dbtype') != 'mysqli') {
         JError::raiseWarning(0, JText::_("Koowa plugin requires MySQLi Database Driver. Please change your database configuration settings to 'mysqli'"));
         return;
     }
     // Check for suhosin
     if (in_array('suhosin', get_loaded_extensions())) {
         //Attempt setting the whitelist value
         @ini_set('suhosin.executor.include.whitelist', 'tmpl://, file://');
         //Checking if the whitelist is ok
         if (!@ini_get('suhosin.executor.include.whitelist') || strpos(@ini_get('suhosin.executor.include.whitelist'), 'tmpl://') === false) {
             JError::raiseWarning(0, sprintf(JText::_('Your server has Suhosin loaded. Please follow <a href="%s" target="_blank">this</a> tutorial.'), 'http://www.joomlatools.com/framework-known-issues'));
             return;
         }
     }
     //Safety Extender compatibility
     if (extension_loaded('safeex') && strpos('tmpl', @ini_get('safeex.url_include_proto_whitelist')) === false) {
         $whitelist = @ini_get('safeex.url_include_proto_whitelist');
         $whitelist = (strlen($whitelist) ? $whitelist . ',' : '') . 'tmpl';
         @ini_set('safeex.url_include_proto_whitelist', $whitelist);
     }
     // Set pcre.backtrack_limit to a larger value
     // See: https://bugs.php.net/bug.php?id=40846
     if (version_compare(PHP_VERSION, '5.3.6', '<=') && @ini_get('pcre.backtrack_limit') < 1000000) {
         @ini_set('pcre.backtrack_limit', 1000000);
     }
     //Set constants
     define('KDEBUG', JDEBUG);
     //Set path definitions
     define('JPATH_FILES', JPATH_ROOT);
     define('JPATH_IMAGES', JPATH_ROOT . DS . 'images');
     //Set exception handler
     set_exception_handler(array($this, 'exceptionHandler'));
     // Koowa : setup
     require_once JPATH_LIBRARIES . '/koowa/koowa.php';
     Koowa::getInstance(array('cache_prefix' => md5(JFactory::getApplication()->getCfg('secret')) . '-cache-koowa', 'cache_enabled' => false));
     KLoader::addAdapter(new KLoaderAdapterModule(array('basepath' => JPATH_BASE)));
     KLoader::addAdapter(new KLoaderAdapterPlugin(array('basepath' => JPATH_ROOT)));
     KLoader::addAdapter(new KLoaderAdapterComponent(array('basepath' => JPATH_BASE)));
     KServiceIdentifier::addLocator(KService::get('koowa:service.locator.module'));
     KServiceIdentifier::addLocator(KService::get('koowa:service.locator.plugin'));
     KServiceIdentifier::addLocator(KService::get('koowa:service.locator.component'));
     KServiceIdentifier::setApplication('site', JPATH_SITE);
     KServiceIdentifier::setApplication('admin', JPATH_ADMINISTRATOR);
     KService::setAlias('koowa:database.adapter.mysqli', 'com://admin/default.database.adapter.mysqli');
     KService::setAlias('translator', 'com:default.translator');
     //Setup the request
     KRequest::root(str_replace('/' . JFactory::getApplication()->getName(), '', KRequest::base()));
     //Load the koowa plugins
     JPluginHelper::importPlugin('koowa', null, true, KService::get('com://admin/default.event.dispatcher'));
     //Bugfix : Set offset accoording to user's timezone
     if (!JFactory::getUser()->guest) {
         if ($offset = JFactory::getUser()->getParam('timezone')) {
             JFactory::getConfig()->setValue('config.offset', $offset);
         }
     }
     // Load language files for the framework
     KService::get('com:default.translator')->loadLanguageFiles();
     parent::__construct($subject, $config);
 }
Exemplo n.º 12
0
 /**
  * Bootstrap the Koowa Framework
  *
  * @return bool Returns TRUE if the framework was found and bootstrapped succesfully.
  */
 public function bootstrap()
 {
     $path = JPATH_LIBRARIES . '/koowa/libraries/koowa.php';
     if (file_exists($path)) {
         /**
          * Koowa Bootstrapping
          *
          * If KOOWA is defined assume it was already loaded and bootstrapped
          */
         if (!defined('KOOWA')) {
             require_once $path;
             $application = JFactory::getApplication()->getName();
             /**
              * Find Composer Vendor Directory
              */
             $vendor_path = false;
             if (file_exists(JPATH_ROOT . '/composer.json')) {
                 $content = file_get_contents(JPATH_ROOT . '/composer.json');
                 $composer = json_decode($content);
                 if (isset($composer->config->vendor_dir)) {
                     $vendor_path = JPATH_ROOT . '/' . $composer->config->vendor_dir;
                 } else {
                     $vendor_path = JPATH_ROOT . '/vendor';
                 }
             }
             /**
              * Framework Bootstrapping
              */
             Koowa::getInstance(array('debug' => JDEBUG, 'cache' => false, 'cache_namespace' => 'koowa-' . $application . '-' . md5(JFactory::getApplication()->getCfg('secret')), 'root_path' => JPATH_ROOT, 'base_path' => JPATH_BASE, 'vendor_path' => $vendor_path));
             /**
              * Component Bootstrapping
              */
             KObjectManager::getInstance()->getObject('object.bootstrapper')->registerComponents(JPATH_LIBRARIES . '/koowa/components', 'koowa')->registerApplication('site', JPATH_SITE . '/components', JFactory::getApplication()->isSite())->registerApplication('admin', JPATH_ADMINISTRATOR . '/components', JFactory::getApplication()->isAdmin())->bootstrap();
         }
         $manager = KObjectManager::getInstance();
         $loader = $manager->getClassLoader();
         //Module Locator
         $loader->registerLocator(new ComKoowaClassLocatorModule(array('namespaces' => array('\\' => JPATH_BASE . '/modules', 'Koowa' => JPATH_LIBRARIES . '/koowa/modules'))));
         /**
          * Module Bootstrapping
          */
         $manager->registerLocator('com:koowa.object.locator.module');
         /**
          * Plugin Bootstrapping
          */
         $loader->registerLocator(new ComKoowaClassLocatorPlugin(array('namespaces' => array('\\' => JPATH_ROOT . '/plugins', 'Koowa' => JPATH_LIBRARIES . '/koowa/plugins'))));
         $manager->registerLocator('com:koowa.object.locator.plugin');
         /**
          * Context Boostrapping
          */
         $request = $manager->getObject('request');
         // Get the URL from Joomla if live_site is set
         if (JFactory::getApplication()->getCfg('live_site')) {
             $request->setBasePath(rtrim(JURI::base(true), '/\\'));
             $request->setBaseUrl($manager->getObject('lib:http.url', array('url' => JURI::base())));
         }
         //Exception Handling
         if (PHP_SAPI !== 'cli') {
             $manager->getObject('event.publisher')->addListener('onException', array($this, 'onException'), KEvent::PRIORITY_LOW);
         }
         // Handle 404 errors gracefully after log outs
         $manager->getObject('event.publisher')->addListener('onException', array($this, 'onErrorAfterLogout'), KEvent::PRIORITY_HIGH);
         /**
          * Plugin Bootstrapping
          */
         JPluginHelper::importPlugin('koowa', null, true);
         return true;
     }
     return false;
 }
Exemplo n.º 13
0
 *
 * @copyright   Copyright (C) 2007 - 2014 Johan Janssens and Timble CVBA. (http://www.timble.net)
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        https://github.com/nooku/nooku-framework for the canonical source repository
 */
/**
 * Koowa Bootstrapping
 *
 * If KOOWA is defined assume it was already loaded and bootstrapped
 */
if (!defined('KOOWA')) {
    /**
     * Joomla Configuration
     */
    require_once JPATH_CONFIGURATION . '/configuration.php';
    $config = new JConfig();
    /**
     * Joomla Version
     */
    require_once JPATH_LIBRARIES . '/cms/version/version.php';
    $version = new JVersion();
    /**
     * Framework Bootstrapping
     */
    require_once __DIR__ . '/code/libraries/koowa/libraries/koowa.php';
    Koowa::getInstance(array('debug' => $config->debug, 'cache' => false, 'cache_namespace' => 'koowa-' . JPATH_BASE === JPATH_SITE ? 'site' : 'admin' . '-' . md5($config->secret), 'root_path' => JPATH_ROOT, 'base_path' => JPATH_BASE, 'vendor_path' => false));
    /**
     * Component Bootstrapping
     */
    KObjectManager::getInstance()->getObject('object.bootstrapper')->registerComponents(JPATH_LIBRARIES . '/koowa/components', 'koowa')->registerApplication('site', JPATH_SITE . '/components', JPATH_BASE === JPATH_SITE)->registerApplication('admin', JPATH_ADMINISTRATOR . '/components', JPATH_BASE == JPATH_ADMINISTRATOR)->bootstrap();
}