public static function executePackage(
        $package,
        $task,
        Request $request,
        $config = [],
        $appClass = 'Windwalker\Web\Application'
    ) {
        $profile = Ioc::getProfile();

        Ioc::setProfile('web');

        if (!class_exists($appClass)) {
            throw new \LogicException($appClass . ' not found, you have to provide an exists Application class name.');
        }

        if (!is_subclass_of($appClass, WebApplication::class)) {
            throw new \LogicException('Application class should be sub class of ' . WebApplication::class);
        }

        /** @var WebApplication $app */
        $app = new $appClass($request);
        $app->boot();
        $app->getRouter();

        $package = $app->getPackage($package);

        $container = $app->getContainer();

        $container->share('current.package', $package);
        $container->get('config')->load($config);

        $response = $package->execute($task, $request, new \Windwalker\Http\Response\Response());

        Ioc::setProfile($profile);

        return $response;
    }