public static function bootstrap($base)
    {
        if (!class_exists('\\JApplicationCli'))
        {
            $_SERVER['HTTP_HOST'] = 'localhost';
            $_SERVER['HTTP_USER_AGENT'] = 'joomlatools-console/' . \Joomlatools\Console\Application::VERSION;

            if (!defined('_JEXEC')) {
                define('_JEXEC', 1);
            }

            if (!defined('DS')) {
                define('DS', DIRECTORY_SEPARATOR);
            }

            if (Util::isPlatform($base))
            {
                define('JPATH_WEB'   , $base.'/web');
                define('JPATH_ROOT'  , $base);
                define('JPATH_BASE'  , JPATH_ROOT . '/app/administrator');
                define('JPATH_CACHE' , JPATH_ROOT . '/cache/site');
                define('JPATH_THEMES', __DIR__.'/templates');

                require_once JPATH_ROOT . '/app/defines.php';
                require_once JPATH_ROOT . '/app/bootstrap.php';
            }
            else
            {
                define('JPATH_BASE', realpath($base));

                require_once JPATH_BASE . '/includes/defines.php';
                require_once JPATH_BASE . '/includes/framework.php';
            }
        }
    }