Dependency injection.... on steroïds!

Mouf is an open-source PHP framework providing an easy way to download, install, use and reuse components, with a graphical user interface.

Get started!

install
Tutorial 1: install
Tutorial 2: use
use
build
Tutorial 3: build

The idea

lego bricks

In the heart of Mouf lies a Dependency Injection framework. You might have heard about Dependency Injection. Most developers will tell you that Dependency Injection is good, because it reduces the dependencies between components. This is true. They will also tell you that the main interest of Dependency Injection is easier unit testing. And most developers will struggle with huge XML files declaring the dependencies. Basically, they trade a better design for a complex dependency management.

We, Mouf developers, believe something went wrong. Dependency Injection should not be about Unit Testing, and it should not require huge dependency files! Dependency Injection is about having well defined components. If you had such components, building your application should be the same as playing with Lego bricks! Building an application should be about reusing existing components, and only adding a few new ones that are the core of your application. We believe that tying those bricks together should be done graphically using a nice user interface.

So we decided to create Mouf. Mouf is a PHP framework providing an easy way to download, install, use and reuse components, with a graphical user interface.

Mouf also provides a bunch of additional features like:

Core packages list

Mouf is only the core of a reusable set of packages that will help you build your PHP applications quickly. The list of package below is only a subset of all Mouf packages. We call this subset the "Core Mouf packages", but there are many other packages available (more than 100). Check out the full packages list.

> Controllers
Splash
A components-based MVC framework
> Templating
Base template
A base templating class you can extend to provide your own templates
Splash template
A simple template class to get started
Mouf template
The template used in the Mouf interface. You can use it for your own project if you wish
> Internationalization
FINE
An internationalisation package offering a nice graphical interface inside Mouf
> Logging
LogInterface & ErrorLog Logger
Mouf comes with an advanced logging system. Depending on the package you use, you can log requests to the PHP error log, receive a mail automatically, or log errors in database, ...
Advanced logger
The ultimate logger. Stores in database, computes statistics and sends report mails.
> Database
DB Connection
Components to access your database
TDBM
A database ORM to directly map you database into objects and Mouf components. TDBM will guess your queries based on the database model!
DB Stats
A package to compute statistics from your database. It can transform your MySQL database into an OLAP database and use triggers to keep statistics up-to-date.
> HTML (grids, forms...)
Base Widgets
Contains a set of components that can be used to render HTML. This package is especially useful to render forms.
/html/widgets group
The /html/widgets group contains many useful packages. Some can render datagrids, others advanced HTML widgets (sliders, captcha, menus, etc...).
> Mail delivery
Smtp Mail Service
Send mails easily with this composant based on the Zend Framework mail classes. Easy configuration with possible presets to send your mails through Gmail if you don't have a SMTP server.
> Performance and Cache
Cache subsystem
Use the cache subsystem to put data in cache. There are many packages depending on the cache backend you use: APC, Memcache, Redis, a simple file-based cache ...
> Authentication & Security
User Service
A basic service to manage user login and sessions. Database agnostic.
Rights Service
A basic service to manage user rights. Database agnostic.
> Integration
Druplash: Drupal integration
Using Druplash, you can integrate Mouf and the Splash MVC framework into Drupal. This means having a nice MVC framework and object-oriented programming right into Drupal!

New in Mouf 2: improved validators

Mouf has had self-check validators for quite a long time now. And for quite a long time, it was possible to extend those validators in your packages.

It was possible, but not complely easy, as you add to write several conf files to set them up.

This time is over! Now, you can write your own validators in a breeze, just by extending one interface.

Check out the documentation!

Here is a sample:

What's new in Mouf2

In this article, I will add every day what's new in the upcoming Mouf 2.0 release!

This article will be regularly updated as we add new features to Mouf 2.0

Major changes

- The Mouf packaging system has been completely deprecated and replaced by Composer, that will very certainly become the new de-facto packaging standard.

Where are the unit tests?

Hmmm... well... ok, as of april 2012, there are no unit tests yet.
Shame on us!
Actually, we are not completely sure on the way to integrate unit tests in Mouf. Most unit test libraries create automatically the instance of the test classes and we would like Mouf to be able to create the instances for the unit test library.
Since, we don't want to build our own testing framework. We would like instead to be able to rely on an existing framework.
So we are looking for the best solution before integrating unit tests into Mouf.

Mouf is supposed to be a dependency injection framework! So why is the MoufManager class a singleton?

That's a pretty good question! Thanks for asking!

To understand, you must for know that MoufManager is acting as the "IOC container". It is the MoufManager class that is in charge of retrieving/creating your instances.
Therefore, it is almost always sure that there will be only one MoufManager instance available accross your application.

Is Mouf ready for a production environment?

Yes it is! Although Mouf is still in a very active development state, it is already used in many websites, including apideo.com, butterflive.com, pathefilms.com, managerinprogress.com, coeos-assurances.com, etc...

What does MOUF means?

Ha, thanks for asking. It means... "Most Obviously a Useless Framework"... noooo just kidding :) It means... well... ok, we have not figured out what it means yet. But I'm sure someone must know, maybe you! You have an idea? Post your idea on the mailing list, and let's run this open contest to see what "Mouf" means!

Announcing Mouf 0.9 - First official release of Mouf

We are proud to announce the first officiel release of Mouf.
Labelled Mouf v0.9, you can download it from the download page.

Why did we start with version 0.9?
Even if there has been no official release of Mouf yet, Mouf has been in development for more than 3 years. Actually, some packages in Mouf have been started 6 years ago! So it deserves better than a simple "alpha" release, or v0.1 release.

New: weak instances coming to Mouf

Mouf is now supporting weak instances. Any instance can now be declared "weak". When a "weak" instance is no more referenced, it will be automatically garbage-collected. This will help you keeping big projects clean by making sure any unused instance is indeed destroyed instead of polluting your workspace.

Click here to learn more about weak instances

New documentation feature : introducing video tutorial!

We inaugurate a new era for Mouf documentation with a brand new feature : video tutorials.

And here it is :

New in Mouf: documentation support for packages

A good package should always be documented. But where should this documentation go? On a website to be easily accessible? Inside the package so you can find the documentation even after the package is no more maintained and the website has gone blank?