Welcome
Save tens of thousands of dollars* worth of development time by
boosting your productivity with the most powerful, zero config
object relational mapper the industry has ever known.
Powering enterprise web applications since 2009 and still running strong.
* read the case study
News
: Added PHP 8.3 to Travis-CI test matrix
: RedBeanPHP 5.7.4 (Jubilate Sunday Edition) New
: RedBeanPHP 5.7.3 (Jubilate Sunday Edition)
: RedBeanPHP 5.7.2 (Jubilate Sunday Edition)
: RedBeanPHP 5.7.1 (Jubilate Sunday Edition)
: RedBeanPHP 5.7 (Jubilate Sunday Edition)
: RedBeanPHP 5.6.2 (Christmas Edition)
: RedBeanPHP 5.6.1 (Christmas Edition)
: RedBeanPHP 5.6 (Christmas Edition)
: RedBeanPHP 5.5 (Pentecost Edition)
: RedBeanPHP 5.4 (St. Nicholas Edition)
: RedBeanPHP 5.3 (Palm Sunday Edition)
DEMO: Quickly import CSV
Let's import a CSV of country codes in just about a minute, including the time to download and
install RedBeanPHP!
With RedBeanPHP you don't need to design your database schema upfront, you don't need
a database administrator, you don't need endless configuration files in yaml, xml or json,
you don't need hundreds of untrusted dependencies or a sluggish framework, just one file and go!
Code Example
This is how you do CRUD in RedBeanPHP:
require 'rb.php';
R::setup();
//for version 5.3 and higher
//optional but recommended
R::useFeatureSet( 'novice/latest' );
$post = R::dispense( 'post' );
$post->text = 'Hello World';
//create or update
$id = R::store( $post );
//retrieve
$post = R::load( 'post', $id );
//delete
R::trash( $post );
This automatically generates the database, tables and columns... on-the-fly. It infers relations based on naming conventions. RedBeanPHP also makes it very easy to work with trees in databases:
$pages = R::children( $site, $extraSQL );
RedBeanPHP uses recursive table expressions to deal with tree structures in your database to improve performance (to use this feature you need a database that supports RCTEs like MySQL 8.0.1+, MariaDB 10.2.2+ or PostgreSQL 9+). Learn more about RedBeanPHP trees.
In RedBeanPHP 5.3 and higher you can use R::useFeatureSet( 'novice/latest' ) to automatically select the latest features. If you are working on an older code base you can ommit this line. The latest keyword means that you want to use the latest features. The novice keyword means that some dangerous features like R::nuke() will be turned off. You can also specify a specific RedBeanPHP version like 5.3 (minimum).
Zero Config
No verbose XML files, no annoying annotations, no YAML or INI. Zero Config. Just start coding.
Fluid Schema
During development, RedBeanPHP will adapt the database schema to fit
your needs, giving you the NoSQL experience.
When deploying to production servers, you can freeze the schema and
benefit from performance gains and referential integrity.
RedBeanPHP offers the best of both worlds!
Powerful
RedBeanPHP features:
auto-discovery of models, fast trees,
deep copying and smart import.
Write less, do more!
Compatible
RedBeanPHP strives to support all ALL Free, Open Source databases.
Currently, RedBeanPHP supports:
MySQL, MariaDB, SQLite, PostgreSQL, CUBRID and Firebird/Interbase***.
RedBeanPHP supports PHP version HHVM, 5.3.0-5.3.2**, 5.3.3, 5.4, 5.5, 5.6, 6.0*, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2 and 8.3. We take
backward compatibility very serious! RedBeanPHP has a track record of 18 years of
PHP language level compatibility without a single breaking change! You can trust RedBeanPHP.
*=partial (according to community)
**=requires patch
***=experimental
Quality Software
The library has been created in 2009 and
is now considered quite mature. No major bugs have been found since 2013 and
only minor features have been added in recent years. The code base is being
tested with every change, there are over 20338* unit tests (100% code coverage) for PHP 5.3-latest and all
supported databases. The project is
actively maintained and we take backward compatibility *very* serious.
The code is well-documented.
RedBeanPHP is trusted by many developers worldwide and has over 2.1 million installs on
packagist alone! (since 3.5)
and more than 2k stars on github, furthermore thousands of projects have RedBeanPHP as a dependency.
Signify keys and checksums are provided.
*=running the full (!) unit test suite
Download
Download the easy-to-use one-in-all package, one single file containing the entire RedBeanPHP library!
No composer, no auto-loaders, no configuration, just download and run!
Go to the DOWNLOAD page and download to latest
version of RedBeanPHP!
Github repository: RedBeanPHP on Github.
Travis-CI Test Dashboard: RedBeanPHP on Travis.
API Documentation: RedBeanPHP API Documentation.
Community Forum: RedBeanPHP Community Forum.
Your logo on this website?
Notice something strange? There is no cookie dialog on this site! That's because I don't track you in any way. I fully respect your privacy and I want to offer you a high-quality website without annoying ads. So, no ads, no cookies, no tracking pixels, no MBs of Javascript, not even server-side tracking, nothing! That keeps this website clean, very fast, secure and comfy to use. Hell! I don't even know how many visitors there are on this site! To help me keep this website this way, please consider becoming a sponsor of RedBeanPHP and have your company logo on the website! Contact me for more information.
RedBeanPHP is written by BDFL Gabor de Mooij and the RedBeanPHP community.
Other Projects
Also take a look at some of my other projects:
Stamp Template Engine for PHP (a strict logic-less template engine).
The Straight Framework for PHP (a no-nonsense framework for PHP).
back to main menu
Donate to RedBeanPHP using Monero:
47mmY3AVbRu 7zVVd4bxQnzD
2jR7PQtBJ cF93jWHQ
rP7yRED4qr fqu6G9Q8ZNu7
zqwnB28rz76 w7MaExf
mALVg69yFd 9sUmz
(remove spaces and new lines)
Performance monitor: this page has been generated in 0.016830205917358s.
Is the performance lacking? Please drop me an e-mail to notify me!
RedBeanPHP Easy ORM for PHP © 2024 Gabor de Mooij
() and the RedBeanPHP community
(credits) - Licensed New BSD/GPLv2 -
RedBeanPHP Archives
RedBeanPHP, the power ORM for PHP since 2009.
Privacy Statement