README

Installation via Composer

Just open your composer.json file and add the package name (e.g. "gabordemooij/redbean": "dev-master") in your require list.

{
"require": {
"gabordemooij/redbean": "dev-master"
}
}

NOTE:
You will find many examples on the RedBean website make use of RedBean's R class. Because of namespaced autoloading in Composer, this class will be available as \RedbeanPHP\R instead of R. If you desire to use the much shorter R alias, you can add a use statement at the beginning of your code:

use\RedBeanPHP\RasR;

NOTE:
It is important to note that when using RedBeanPHP with Composer, there are some extra precautions needed when working with Models. Due to the namespace requirements of Composer, when creating Models we need to use the SimpleModel to extend, not RedBean_SimpleModel. Furthermore, we need to specify the namespace of the SimpleModel, so a full example of using a Model with RedBean with Composer is as follows:

use\RedBeanPHP\R;classModel_Userextends\RedBeanPHP\SimpleModel{...}

Notice that we also need to add the use \RedBeanPHP\R statement so that we can use the R:: shortcut within the Model.