RedBeanPHP
RedBeanPHP is an independent, free, BSD licensed, open-source object–relational mapping (ORM) software written by Gabor de Mooij.
≈ 5 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
RedBeanPHP is an independent, free, BSD licensed, open-source object–relational mapping (ORM) software written by Gabor de Mooij. It is a stand-alone library, not part of any framework. RedBeanPHP is an on-the-fly object–relational mapper, this means there is no upfront configuration. The system relies on conventions entirely and adapts the database schema to fit the needs of the program. This way, it strikes a balance between NoSQL and traditional RDBMS solutions.
Features
edit edit sourceRedBeanPHP is different from other ORM systems because it requires no configuration in XML, YAML or JSON. It adapts the database schema based on the needs of the program. All tables and columns are created on-the-fly, without upfront configuration or mapping. It automatically adds columns to tables if necessary and changes the type of the column to match its content requirements. When the developer is done developing and no more schema changes are expected, the schema can be frozen for deployment to production environments. After freezing the database no more schema alterations take place. Relations among tables are mapped in the same way: by convention. For instance, to create a one-to-many relationship between two tables one assigns an array to the property bearing the name of the target table. This automatically creates the table as well as the required columns.
Code example, demonstrating a simple CRUD operation and a relation:
R::setup(); $movie = R::dispense('movie'); $movie->title = 'Beans in space'; $character = R::dispense('character'); $character->name = 'hero'; $movie->ownCharacterList[] = $character; $id = R::store($movie);Influence
edit edit sourceRedBeanPHP is the first library known to adopt the on-the-fly approach towards ORM. As such it has a big influence on other libraries. RedBeanPHP inspired many other projects to embrace this approach towards object mapping. Similar libraries have appeared for .NET,[1] Python,[2] JavaScript,[3] Java,[4] Erlang,[5] ColdFusion[6] and Objective-C.[7]
Integration
edit edit sourceWhile being an independent library, plugin modules have been developed for various popular frameworks like: Laravel,[8] CodeIgniter,[9] Kohana,[10] Silex[11] and Zend Framework.[12] Besides integration modules, some frameworks ship with RedBeanPHP out-of-the-box like The Nibble Framework.[13]
History
edit edit sourceRedBeanPHP first appeared in 2009 on GitHub.[14] The first publicly available version was 0.3.3. RedBeanPHP has been developed by Gabor de Mooij, a software developer from the Netherlands. Because RedBeanPHP is very accessible and it does not hide the SQL language it is used by Universities to teach database programming.[15] According to a forum post by Gabor himself the library has been inspired by a rant about object relational mapping systems by Ted Neward called the 'ORM, Vietnam of computer science'.[16][17]
Reception
edit edit sourceBased on the reviews and presentations available on the web, the overall reception of RedBeanPHP seems to be positive.[18][19][20][21] However the library is less suitable for projects with existing databases and does not support custom table and column mappings, for instance it is not possible to use table prefixes.[22] Also, none of the major frameworks has incorporated the library.
See also
edit edit sourceReferences
edit edit source- ^ LimeBean, RedBeanPHP-inspired data access layer for .NET Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ PyBean, RedBeanPHP inspired ORM for Python Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ "Tayr". npm. Retrieved 2016-07-02.
- ^ RedBean4J RedBean inspired ORM for Java (now abandoned) Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ RedBean-Erlang Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ RedBeanCF Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ CocoaBean, RedBeanPHP inspired library for Objective-C Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ RedBeanPHP bundle for Laravel Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ codeigniter-redbean plugin for the CodeIgniter Framework Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ Kohana Integration module Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ RedBean Service Provider for Silex Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ Zend Framework integration of RedBeanPHP Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ Nibble Framework: a plugin-based framework for PHP Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ [1] First commit of RedBeanPHP on Github Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ http://www.cs.wcupa.edu/rkline/wp/mysql-php.html The West Chester University Computer Science Department RedBeanPHP course Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ Post on forum detailing inspiration for RedBeanPHP Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ The Vietnam of Computer Science Archived 2010-04-30 at the Wayback Machine
- ^ SitePoint Review of RedBeanPHP Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ Interview CEO Zurmo, mentions RedBeanPHP Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ RedBeanPHP Review by Dreamincode[link removed] Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ Review of RedBeanPHP with existing database Wikipedia revision 1371412353, retrieved 2026-11-18
- ^ Checklist suitable projects on the RedBeanPHP website Wikipedia revision 1371412353, retrieved 2026-11-18
External links
edit edit sourceText derived from https://en.wikipedia.org/w/index.php?oldid=1371412353 under CC BY-SA 4.0; modifications have been made.