php redbean update,redbean: RedBeanPHP 可以让你用 NoSQL 的语法来使用 ORM 框架

RedBeanPHP 5

redbean.svg?branch=master

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 (recommended)

Download RedBeanPHP from the website:

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

Optional: sha256sum and check signature.

Installation via Composer (not recommended)

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:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值