PHPackages                             windwalker/application - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. windwalker/application

ActiveWindwalker-package[Framework](/categories/framework)

windwalker/application
======================

Windwalker Application package

3.5.23(6y ago)12341LGPL-2.0-or-laterPHPPHP &gt;=7.1.3

Since Oct 5Pushed 2y ago4 watchersCompare

[ Source](https://github.com/windwalker-io/application)[ Packagist](https://packagist.org/packages/windwalker/application)[ Docs](https://github.com/ventoviro/windwalker-application)[ RSS](/packages/windwalker-application/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (7)Versions (83)Used By (1)

Windwalker Application
======================

[](#windwalker-application)

Windwalker application is a kernel as main entry of your system.

Installation via Composer
-------------------------

[](#installation-via-composer)

Add this to the require block in your `composer.json`.

```
{
    "require": {
        "windwalker/application": "~3.0"
    }
}
```

Create An Application
---------------------

[](#create-an-application)

Create application and extends the `doExecute()` method to something.

```
use Windwalker\Application\AbstractApplication;
use Windwalker\IO\Input;
use Windwalker\Structure\Structure;

class MyApplication extends AbstractApplication
{
    protected function init()
    {
        // Do stuff.

        // Get config
        $this->get('foo'); // bar
    }

    public function doExecute()
    {
        try
        {
            // Some code here...
        }
        catch (\Exception $e)
        {
            Error::renderErrorPage();
        }

        return true;
    }
}

$app = new MyApplication(new Structure(array('foo' => 'bar')));

$app->execute();
```

Config is `Structure` object, see [Windwalker Structure](https://github.com/ventoviro/windwalker-structure)

WebApplication
--------------

[](#webapplication)

`AbstractWebApplication` contains `WebEnvironment` and `WenHttpServer` object that help us handle HTTP request and output.

### WebEnvironment

[](#webenvironment)

Use `WebEnvironment` to get information of browser or server.

```
$this->environment->browser->getBrowser(); // Get browser name
```

Use `Platform` to get server information.

```
$this->environment->platform->isUnix();
```

See: [Environment Package](https://github.com/ventoviro/windwalker-environment)

### PSR7 Handler

[](#psr7-handler)

`dispatch()` is a standard PSR7 handler so we can write our logic here, just return Response object and the `WebHttpServer`object which in Application will render it to client.

```
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Windwalker\Application\AbstractWebApplication;

class MyHttpKernel extends AbstractWebApplication
{
	public function dispatch(Request $request, Response $response, $next = null)
	{
		// Get request query
		$query = $request->getQueryParams();

		// Get Psr Uri
		$uri = $request->getUri();

		// Write body
		$response->getBody()->write('Hello World~~~!');

		return $response;
	}
}

$app = new MyHttpKernel;

$app->execute();
```

Result:

```
Hello World~~~!
```

### Error Handler

[](#error-handler)

Set error handler as final handler so we can use it in `dispatch()`.

```
class MyHttpKernel extends AbstractWebApplication
{
	public function dispatch(Request $request, Response $response, $next = null)
	{
		try
		{
			throw new \Exception('Whoops~', 500);
		}
		catch (\Exception $e)
		{
			return $next($e, $request, $response);
		}

		return $response;
	}
}

$app = new MyHttpKernel;

$app->setFinalHandler(function (Exception $e, Request $request, Response $response)
{
    $response->getBody()->write(sprintf('Error %s. Message: %s', $e->getCode(), $e->getMessage()));
});

$app->execute();
```

Result:

```
Error 500. Message: Whoops~
```

See [Windwalker Http Package](https://github.com/ventoviro/windwalker-http)

Cli Application
---------------

[](#cli-application)

This is a example of a simple cli application.

```
// app.php

use Windwalker\Application\AbstractCliApplication;

class MyCliApp extends AbstractCliApplication
{
    public function doExecute()
    {
        // Get options (-h)
        $help = $this->io->get('h');

        if ($help)
        {
            $msg = close();
        }

        // Get arguments
        $arg = $this->getArgument(0);

        // Do some stuff...

        return 0; // Exit code 0 means success
    }
}

$app = new MyCliApp;

$app->execute();
```

Now we can access this app by PHP CLI:

```
php app.php arg1 arg2 -h --option --foo bar --n=a
```

See: [Windwalker IO](https://github.com/ventoviro/windwalker-io)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~0 days

Total

81

Last Release

2396d ago

Major Versions

2.1.9 → 3.0-beta2016-07-04

PHP version history (3 changes)2.0.0-alphaPHP &gt;=5.3.10

3.2PHP &gt;=5.5.9

3.5PHP &gt;=7.1.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1639206?v=4)[Simon Asika](/maintainers/asika32764)[@asika32764](https://github.com/asika32764)

---

Top Contributors

[![asika32764](https://avatars.githubusercontent.com/u/1639206?v=4)](https://github.com/asika32764 "asika32764 (74 commits)")

---

Tags

applicationcli-appcli-applicationpsr7-handlerserverframeworkapplicationwindwalker

### Embed Badge

![Health badge](/badges/windwalker-application/health.svg)

```
[![Health](https://phpackages.com/badges/windwalker-application/health.svg)](https://phpackages.com/packages/windwalker-application)
```

###  Alternatives

[fuel/fuel

FuelPHP is a simple, flexible, community driven PHP 5.4+ framework, based on the best ideas of other frameworks, with a fresh start!

1.5k42.3k](/packages/fuel-fuel)[joomla/application

Joomla Application Package

23404.8k11](/packages/joomla-application)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
