PHPackages                             fwk/core - 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. fwk/core

ActiveLibrary[Framework](/categories/framework)

fwk/core
========

Fwk Core System

v1.0.1(9y ago)1110BSDPHPPHP &gt;=5.3.4

Since Jun 12Pushed 9y agoCompare

[ Source](https://github.com/fwk/Core)[ Packagist](https://packagist.org/packages/fwk/core)[ RSS](/packages/fwk-core/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Fwk\\Core (Application Framework)
=================================

[](#fwkcore-application-framework)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/356cd655b8361d7760c53b9abd9ac4375fda873048b683180c19eaeeb9ef5cc7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66776b2f436f72652f6261646765732f7175616c6974792d73636f72652e706e673f733d61363730613133653663653265643361623866383235386233613632373537366232396262663631)](https://scrutinizer-ci.com/g/fwk/Core/)[![Build Status](https://camo.githubusercontent.com/f7f4beb849bbf1f60356f4a4972c2a9073f00d33dd743c6c175f338ce11b6b2e/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f66776b2f436f72652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/fwk/Core)[![Code Coverage](https://camo.githubusercontent.com/04d9e3bf4395c852a94d0aea0a33ff7f005b38d9c023ed5a8e48c548777da45d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66776b2f436f72652f6261646765732f636f7665726167652e706e673f733d31333433616430393364333733323966306339646534613736656364653235666135613266323065)](https://scrutinizer-ci.com/g/fwk/Core/)[![Latest Stable Version](https://camo.githubusercontent.com/e4a57990d29f4837cb23ba0498143446cf741c956b7c5f7dd90eb02688dc5c63/68747470733a2f2f706f7365722e707567782e6f72672f66776b2f636f72652f762f737461626c652e706e67)](https://packagist.org/packages/fwk/core)[![Total Downloads](https://camo.githubusercontent.com/09c75372a78dccc87f95d4d104ff78ffb1df616ebd302b3fd779aeeac20ddc69/68747470733a2f2f706f7365722e707567782e6f72672f66776b2f636f72652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/fwk/core)[![Latest Unstable Version](https://camo.githubusercontent.com/683d3ce8c326efc3a81200d8349c98495b60fda084ed90602d520a5877480967/68747470733a2f2f706f7365722e707567782e6f72672f66776b2f636f72652f762f756e737461626c652e706e67)](https://packagist.org/packages/fwk/core)[![License](https://camo.githubusercontent.com/2c314cda28031dbfd6d5bfedc170842a38bca4a7fcc19907bddc5452b96662cb/68747470733a2f2f706f7365722e707567782e6f72672f66776b2f636f72652f6c6963656e73652e706e67)](https://packagist.org/packages/fwk/core)

Core is a zero-configuration application framework that makes developers happy :)

Installation
------------

[](#installation)

Via [Composer](http://getcomposer.org):

```
{
    "require": {
        "fwk/core": "dev-master",
    }
}

```

If you don't use Composer, you can still [download](https://github.com/fwk/Core/zipball/master) this repository and add it to your `include_path` [PSR-0 compatible](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)

Introduction
------------

[](#introduction)

Core can be used diffently depending on your application needs and how you plan to maintain and make it evolves in time. There is no directory-structure dependencies nor "recommended pattern". Knowing how to configure PHP 5.3+ on your environment is the only prerequisite.

A Request to an *Application* calls an *Action* (Controller) which sometimes uses *Services* (Model) to return a *Result* (View). Fwk\\Core let you use any type of Action thanks to *ActionProxies*. An object containing the *Request* (and the *Response*) is shared during the runtime, it is the *Context*. The runtime creates *Events* emitted by the Application that can be used by *Listeners* to extends its behavior.

Included ActionProxies are:

- CallableActionProxy(`callable`): calls `callable`
- ControllerActionProxy(`className`,`methodName`): instanciate `className` and calls `methodName`
- IncludeActionProxy(`file.php`): includes `file.php`
- ServiceActionProxy(`serviceName`): executes the Service registered as `serviceName`
- ServiceControllerActionProxy(`serviceName`, `methodName`): executes `methodName` on the Service registered as `serviceName`

Its suggested to use `Fwk\Core\Action\ProxyFactory` as a shortcut to the corresponding `Fwk\Core\ActionProxy`, like:

```
$app->register('Hello', ProxyFactory::factory(function() { /* ... */ })); // CallableActionProxy
$app->register('Hello', ProxyFactory::factory('+file.php')); // IncludeActionProxy
$app->register('Hello', ProxyFactory::factory('HelloWorld\\HelloController:show')); // ControllerActionProxy
$app->register('Hello', ProxyFactory::factory('@service')); // ServiceActionProxy
$app->register('Hello', ProxyFactory::factory('@service:method')); // ServiceControllerActionProxy
```

### Hello World Application

[](#hello-world-application)

This is probably the simplest example:

```
