raincious/facula 2014-10-18 08:07 UTC


Facula is a highly extensible experimental non-full-stack framework written in PHP.

It aim to provide a stable interface for the ground floor to make your application can be fit to various environments without changing existing code.


  • Under: Development
  • Project: Experimental (Production not recommended)
  • Build Status

How to get it

You can download or clone it from Github, or use Composer

Install with composer (Recommended)

Install the Composer, and run:

cd [To/Your/Project/Path]
composer require raincious/facula "master"

Clone with Git

Install Git and run:

cd [To/Your/Project/Path]
git clone https://github.com/raincious/facula

After that, require The framework by adding


Into your index.php or other common procedure file.

Download it manually

See The release section.

Initialize it

To power-on the framework, you need to initialize by the run method.



use Facula\Framework;


And then, you will be able to use all the functions provided by the framework:

Framework::core('response')->setContent('Hello World');

For more information of framework usage, please see the examples.

Porting to Facula

Facula is Not a MVC framework that strictly limit the usage and force you to use MVC pattern.

Which means you can still work with your procedural project and add the framework in.

Notes on porting from a procedural project

For managing the ground floor properly, the framework need a environment that can't be interfere. That's means, you can't use function like echo to output or ob_* to create buffer. Function that effect globally like mb_internal_encoding is not recommended to use in data handle process.

Keep in mind, in the presuppose, facula will manage the whole workflow from input to output.

For example, when you want to get data from request, you need to use function core request:

$pageID = Facula\Framework::core('request')->getGet('page_id');
$content = Facula\Framework::core('request')->getPost('Content');
$cookie = Facula\Framework::core('request')->getCookie('Cookie');

For response, use the response core:

Facula\Framework::core('response')->setCookie('Cookie', 'I remember you');
Facula\Framework::core('response')->setHeader('Your: header');
Facula\Framework::core('response')->setHeader('Another: header');

However, if you want to keep it your own way and not use the request and response function core, you can disable the request and response function core by simply extends the Facula\Framework class, and modify the protected static $requiredCores array.

Notes on porting from a MVC project

If you already have a MVC project, you can still use your old libraries and even frameworks. And only let Facula to help you to handle tasks as you wish.

For example, you can disable all function cores and just let Facula to manage your project file as a autoloader.

Facula core basically is a component loader, which load up components according your configuartion and get them ready to use.

Start a new project with Facula

Please see the example project in examples\BasicStart folder. It showing how to start a fresh MVC project based on Facula Framework.