davidmars/redbean
Composer 安装命令:
composer require davidmars/redbean
包简介
RedBeanPHP ORM (with an after_open event on models...)
关键字:
README 文档
README
RedBeanPHP is an easy to use ORM tool for PHP.
- Automatically creates tables and columns as you go
- No configuration, just fire and forget
- No complicated package tools, no autoloaders, just ONE file
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\R as R;
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; class Model_User extends \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.
Quick Example
How we store a book object with RedBeanPHP:
$book = R::dispense("book"); $book->author = "Santa Claus"; $book->title = "Secrets of Christmas"; $id = R::store( $book );
Yep, it's that simple.
More information
For more information about RedBeanPHP please consult the RedBeanPHP website:
davidmars/redbean 适用场景与选型建议
davidmars/redbean 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 160 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 02 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「orm」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 davidmars/redbean 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 davidmars/redbean 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 davidmars/redbean 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Kinikit - PHP Application development framework MVC component
PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2
PeskyORM - annoying ORM that contains tons of exceptions and throws them when anything goes wrong
An ORM solution for Salesforce Object Query Language (SOQL)
LDAP ORM for Symfony2
Database layer for the Luany ecosystem — PDO connection, Model base, QueryBuilder, and Migration engine.
统计信息
- 总下载量: 160
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: New
- 更新时间: 2018-02-11