redbean

ORM layer that creates models, config and database on the fly

  • 所有者: gabordemooij/redbean
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

RedBeanPHP 5

Build Status

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

Download RedBeanPHP from the website:

https://redbeanphp.com/download

Extract the archive and put it in your PHP project, voila!

Optional: sha256sum and check signature.

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:

https://www.redbeanphp.com/

主要指標

概覽
名稱與所有者gabordemooij/redbean
主編程語言PHP
編程語言PHP (語言數: 2)
平台
許可證
所有者活动
創建於2009-05-29 07:39:09
推送於2025-05-01 17:42:02
最后一次提交2025-05-01 19:41:56
發布數37
最新版本名稱v5.7.4 (發布於 2023-03-18 00:01:57)
第一版名稱v3.2 (發布於 2012-05-07 23:29:12)
用户参与
星數2.3k
關注者數88
派生數278
提交數3k
已啟用問題?
問題數735
打開的問題數3
拉請求數148
打開的拉請求數0
關閉的拉請求數69
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?