Every six months a new version of RedBeanPHP is released. Here you find the changes in each revision starting from version 4.0. You can download the latest RedBeanPHP from the Download Page
Changes in version 5.1 (2 April 2018, Easter Edition)
- Added R::trashBatch($type, $ids) to trash a batch of beans in one statement
- Added R::hunt( $type, $query, $params ) to find and trash beans in one statement
- Added Debugger::setOverrideCLIOutput() to override PHP_SAPI in Debugger
- Improved API documentation box()/unbox()
- Improved API documentation matchUp
- Make QuickExport compatible with PHP versions 5.4 and below
- Add warning in API documentation regarding use of findLast()
- Mark R::findLast() as deprecated
- Fixed compatibility issue with PHP 7.2 (thanks Lynesth)
- Increases execution speed if no conditions are set (thanks Lynesth)
- Added DispenseHelper::setEnforceNamingPolicy() to disable naming policy
- Faster return from __call() if no model (thanks Lynesth)
- Updated README and Composer JSON (thanks Rotzbua)
- Added Composer Model documentation (thanks Ben Major)
- Fix Facade::convertToBean documentation (thanks Diogo Oliveira de Melo)
- Reached 100% test coverage
- Code clean-ups
- Improved other documentation
- Tiny Query Builder now available as plugin for your convenience
- Improved performance of modifySchema() (thanks davidsickmiller)
- Fixed a compatibility issue with ProxySQL in connection mechanism
Changes in version 5.0 (31 October 2017, Halloween Edition)
- Simplified Exceptions for load() functions
- By default R::load() and R::loadForUpdate() will now throw exceptions if a bean cannot be loaded due to a lock timeout
- Support for JSON columns has been extended.
- Update .gitignore (thanks jreklund)
- Update Composer aliasing in readme (thanks benmajor)
- Make filter function in look() optional
- Added R::loadForUpdate() to load and lock a bean
- Separate versions for MySQL, Postgres and SQLite as well as combined
- Storage of partial beans
- R::look(...) perform query and put result in template
- R::matchUp(...) match-and-update in one go (easy to create login functionality)
- R::csv(...) create a CSV file from a query
- R::diff(...) returns a diff between a pair of beans
- Added setEnforceUTF8Encoding to fix issue with stringifying binary data
- Added exists() to bean to check for relation
- Fixed notice in Facade inproper use of reset()
- Added missing validations for findOrDispense and findOneOrDispense
- Support for utf8mb4_unicode_520_ci (thanks Johan)
Changes in version 4.3.4 (March 2017)
- Various minor fixes (github issues 530, 531 and 544)
Changes in version 4.3.3 (October 2016)
- Automatic unboxing for Simple Models if necessary (instead of exception)
- Added findOrDispense() to facade
- Remove support for PHAR, it makes no sense PHP is not JAVA
- Using var_dump instead of print_r in classic debugger for clarity
- Fixed a minor toString issue in FUSE
- Fixed issue in fancy debugger causing bindings to appear incorrectly
- Fixed issue where multi zero string got converted to INT (#525)
Changes in version 4.3.2 (May 2016)
- Added meta-masks
- Added R::convertToBean - for single rows
- Added R::hasDatabase
- Added some color to fancyDebug
- Beans now implement the jsonSerializable interface if available
- Support for JSON columns in Postgres (manual only to avoid breaking stuff)
- Improved source comments
Changes in version 4.3.1 (January 2016)
- Added more source code documentation to clarify handling of NULL in FUSE
- Fixed a minor issue with backticks in fluid mode
- Added a try-catch to avoid errors with Postgres unremovable views (nuke)
Changes in version 4.3.0 (October 2015)
- Add source code highlighting in docs for API
- Compatibility with PHP 7
- Compatibility with HHVM
- Added one() for basic 1-1 support in OODBBean
- Added support for NUMERIC fields (fixed precision) in MySQL/Postgres
- Added proper MarkDown markup to source code documentation
- Moved inline facade functions to new Utility Classes.
- Changed DSN trigger_error into RedException
- Bundled handy test shell scripts for unit testing RB
- Clean up source code documentation
Changes in version 4.2.5 (July 2015)
- Fixed notice when selecting invalid database (now throws Exception instead).
Changes in version 4.2.4 (June 2015)
- Fixed a minor issue with findOne handling redundant LIMIT clauses
Changes in version 4.2.3 (June 2015)
- Fixed information schema performance issue in fluid mode on large MySQL servers (with lots of databases).
- Very very tiny performance optimization for PHP interpreters: using commas instead of dots (but it's a cute trick) - thanks 'dseguy'
Changes in version 4.2.2 (May 2015)
- Added OODB::autoClearHistoryAfterStore()
Changes in version 4.2.1 (May 2015)
- Added a function to set the maximum for integer parameter binding (for edge cases).
- Conditional deprecated PGSQL ATTR constant for compatibility with PHP 7
- Some clean-up in inline documentation
Changes in version 4.2.0 (April 2015)
- NEW Automatically resolve aliases using foreign key inspection
- NEW Support for cursors (for large datasets)
- NEW R::findOrCreate() to directly create a bean with certain values if it does not exist yet
- NEW R::findLike to find beans using an criteria array
- NEW Added $bean->hasListChanged()
- NEW Re-added CUBRID QueryWriter to main repository again
- NEW Easy logging functions
- NEW Deepfreeze
- NEW Global aliases: R::aliases( ... )
- NEW Query Counter
- NEW You can now configure error handling in models (if model does not exist etc...) see API
- NEW You can now use R::fancyDebug() to see parameters embedded in SQL
- NEW Improved caching system
- NEW New, cleaner QueryWriter architecture
- NEW Added GetOne() method in driver (improve ADODB compatibility).
- NEW Added findMulti, for complex mappings.
Backward incompatible changes
- Build commands like 'buildcomamnd.unique' are no longer supported (I always said not to rely on them).
Changes in version 4.1.4 (Februari 2015)
- Fixed slot-issue in debugger (mode 2)
- Added extra MySQL type 7 to avoid utf8mb4-innodb-index issues
- Fixed export issue with certain FUSE hooks
- Add feature to throw exception or trigger error if a FUSE method does not exist
- Re-added static $f for backward compatibility with 3.5 SQL Helper
- Fixed some issues with CUBRID compatibility, re-integrated CUBRID support in master
Changes in version 4.1.3 (December 2014)
- PostgreSQL money fields now accept more currencies
- Improved caching by allowing multiple cache entries per tag
Changes in version 4.1.2 (November 2014)
- Added @joined syntax feature to countOwn as well
- Adjusted clone-syntax to comply with strict PHP code sniffers
- R::$toolboxes R::$toolbox and R::$currentDB are public again for your convenience
Changes in version 4.1 (October 2014)
- R::findOne() adds LIMIT 1 to query if no LIMIT clause is found
- R::tagged() and R::taggedAll() now accept SQL for pagination
- Improved performance parent bean saving
- Improved method signature of dup: R::duplicate
- Custom beans through REDBEAN_OODBBEAN_CLASS constant
- Allow some JOINS in with/withCondition for own-lists.
- Improved support for UUIDs/GUIDs. This feature has been backported to 4.0.5 as well.
- Column functions: bind a function to a column
- Improve setup time by providing direct PDO setter (use with care!)
- Add a method to test the database connection
- Add new debug mode with query parameters filled in
- Add new debug function to inspect beans and arrays of beans
- Treat beans in own-list as shared list: aggregated list
- Split OODB in two repositories: frozen and fluid (no API changes)
- Regular maintenance & clean up
- Additional tests
Backward incompatible changes
RedBeanPHP 4.1 should be fully backward compatible. However, there is one change that may affect some code relying on undefined behaviour. In 4.1 a bean will only be saved if it has been changed through the setter (meta: changed). If a bean is tainted by accessing its lists it will perform all save operations but not fire the actual SQL query if no changes have been made to the bean itself. If for some reason you relied on the redundant SQL query you might want to set the 'changed' meta property manually. You can also implement this system-wide by extending the SimpleModel.
Changes in version 4.0 (April 2014)
- PHP native namespaces
- Exclusive own-list
- Tree Traversal function
- 10% performance improvement for basic CRUD operations
- Performance improvements for bean conversion
- Improved Array Access interface (you can now use arrays instead of beans all the time)
- Improved handling of unique constraints
- Added EID() function to easily insert ENUM bean IDs in queries
- Constraints now also use ON UPDATE CASCADE
- Dispense works more consistently now
- Fixed an issue with type of return ID value in Postgres driver
- Fixed possible cache collision issue
- Performance improvements for fluid mode
- Big clean-up: removed Cooker/Graph (use dispense), Preloader (plugin), BeanCan Server (plugin)
- CUBRID driver still available but as plugin
Version 4 FAQ
This is a list of questions and answers regarding the 4.0 release.
Why has the Preloader been removed?
When I wrote the preloader,
the original purpose was to prevent for-each loops to fire queries when retrieving the parent of a bean.
Later I added the writer cache which could take care of this but was turned off by default.
In RedBeanPHP the writer cache is turned on by default solving the original problem.
Meanwhile people requested all kinds of new features for the Preloader like support for
loading own-lists, shared-lists and even aliases and SQL snippets.
It even got its own syntax. I decided to remove the preloader because
I believe simple SQL is better suited to query large amounts of records all at once for overviews and reports.
This functionality is still available as a plugin.
Why has graph() been removed from core?
R::graph() was a powerful feature to load and updates beans directly from forms. However
the graph() function assumed you were also using FUSE for validation. Otherwise the function
could lead to serious architectural and security defects. I fixed this in version 3, but then
it became less powerful, so in version 4 I decided to remove it entirely from the core.
This functionality is still available as a plugin.
Also note that the new R::dispense() method works much like the old graph() method.
Why is R::associate gone?
The R::associate() method (as well as unassociate etc...) is a relic from the past. In the earliest versions of RedBeanPHP I believed you only needed many-to-many relations. Although this was true, performance became a real bottleneck. I had to find a way to apply the on-the-fly philosophy to N-1 relations as well, this resulted in the introduction of own-lists and shared-lists. Since then, I kept the old associate() method for backward compatibility reasons. In version 4 however I decided to finally clean up.
Why are the BeanCan Servers gone?
They blurred the distinction between plugin and core.
Also, the RedBeanPHP Adaptive branch is going more in the direction of a framework which
is a better place for BeanCan as well. RedBeanPHP 4 returns to the core of the library:
on-the-fly ORM. Another reason is that it turns out it is pretty much impossible to
prescribe the interface of a JSON or REST API.
This functionality is still available as a plugin
New in RedBeanPHP 3.5.7
This is a minor maintenance update.
- Fixed issue in QueryWriter cache (3.5.7b)
- Improved stacktrace in SQL exception
- Improved performance of convertToBeans() method
- Allow duplication of trees
- With now also works with joins
back to main menu