Bacon is a clean, minimalistic and fast MVC framework. Our goal is to ease web development and provide a solid foundation for common use cases.

Getting started

Head over here to dive into Bacon


Get your own copy

Contribute & Support

Find us on Github, get support and help us improve Bacon

Bacon development version

Most work on Bacon happens when we actually use it in our projects. To do this, we now have a "development" version of bacon-dist available in the repository''s master branch. This in turn requires the master of Bacon and Sauce. The tags are considered stable and each include the latest stable version of their dependencies.

Creating a new project using the development version works like this:

% composer create-project brainsware/bacon-dist ProjectName dev-master

Composer will also ask you whether you want to keep the version control information. To keep it without asking, use the --keep-vcs flag.

Bacon releases 0.1.1 - 0.1.5

A couple of weeks have passed since the first release of Bacon, but we did not stop working on it and have released the tags 0.1.1 to 0.1.5 for Bacon and the tag 0.1.1 for Sauce.

The full changelog can be found here.

A few of the changes are worth noting:

bacon-dist package changed

The bacon-dist composer package now requires the latest 0.1.* version so you get updates as soon as they''re released. To update your dependencies run composer update.

Redirects in a Controller''s init() method

In some cases one needs a way to escape a controller very early, e.g. if authentication requirements are not met. The init() method now sports this via redirects.

class Backend extends Application
    protected function init()
        // $this->logged in might be defined in Application
        if (!$this->logged_in()) {
            return $this->redirect([ ''backend/login'' ]);


Most of the changes in \\Bacon\\ORM\\Model and \\Bacon\\ORM\\Collection are refactorings in terms of quality and clean code. All methods querying the database now use prepared statements and a few internal properties now use Sauce Object and Vector instead of builtin arrays.

Two changes however might affect the users of the ORM: A class \\Bacon\\Exceptions\\ValidationError has been added and the static::$timestamps property is now by default true (explicitely set so in \\Bacon\\ORM\\Model).

When calling $model_instance->error(''column'', ''message''); a new ValidationError object is created and pushed, but not thrown.

The case insensitive Router

After moving Bacon to use Composer and its PSR-0 autoloader, controller and view directories had to always start with a capital letter. The router did not care much about the case of the directories and files it searched for, so it depended on the underlying OS or file system whether it was case sensitive or not. On Windows the change to the PSR-0 autoloader did not break anything. On Linux however one had to provide uppercase resource names in the URI, which looks odd. We also did not like the possibility of introducing bugs (okay, we did actually have that bug in our applications) when working on different platforms.

So the router is now case insensitive.

Misc changes

  • The documentation now resides in the Bacon repository instead of''s. That way it comes with your local checkout/download of bacon and can be found in vendor/brainsware/bacon/docs. It is written in Github flavoured markdown.
  • \\Bacon\\Log now outputs timestamps formatted according to ISO 8061.
  • bin/server has been changed to run on port 8080 instead of 80 by default no longer requiring sudo.
  • \\Sauce\\CliColors has been added.

First public Bacon release!

We, Brainsware, have developed Bacon over the last years to cover all our clients' common use cases and thus have created a base for fast and robust web development using PHP. Since we do not want to keep that to ourselves, Bacon is now released to the wild under the Apache-2.0 license.

What makes Bacon special?

PHP and its surrounding development environment, as well as web development practices in general, have evolved quite a bit in the past years and we tried to keep in touch with that. Thus Bacon strives to integrate in all the new and shiny infrastructure available for PHP developers.

  • A very permissive license (Apache-2.0)
  • Full usage of PHP 5.4 features, especially in the underlying general purpose library Sauce
  • PSR-0 and mostly PSR-1 compatible (we prefer #under_score method names instead of #camelCase)
  • Available as Composer packages for ease of installation and dependency management
  • Library, website and skeleton project fully available for you to fork on Github

What does Bacon provide?

Bacon is still quite small and minimalistic, it does however implement a complete MVC structure. With this structure and some conventions Bacon makes it very easy to cover a wide variety of use cases of modern web development.

  • A simple ORM
  • RESTful routing: a simple, standardized way of mapping URIs to controllers also following our principle of convention over configuration
  • Robust controller infrastructure including the standard template engine Twig
  • Standardized upload handling for asynchronous XHR as well as classic HTML uploads
  • Simple ways of turning your controllers into web services or AJAX API endpoints
  • Support for CoffeeScript

Where will Bacon go?

As good as we think Bacon is already, we still have a lot of features lined up in our queue:

  • Migrations, validations and associations for the ORM
  • Standardized error and error message handling in the ORM and controllers
  • Internationalization and localization
  • Proper, automatable unit and regression testing suite with a simple DSL for Bacon, Sauce and the applications built with it
  • API documentation generation that integrates neatly with the rest of documentation
  • Keep up-to-date with new features in PHP

We will try to keep and improve the usability of Bacon as a whole, to further ease web development.

If you have any questions, feature request or just want to get in touch don''t hesitate to contact us on Github. We also encourage you to fiddle around with Bacon and its environment yourself, if you feel like something is missing, you found a typo or just want to experiment. So fork us and send us pull requests!