miladalsh / couchbase-yii2
此扩展为 Yii2 框架提供了 Coucbase SDK 集成
dev-master
2015-05-07 14:10 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-10-02 08:47:04 UTC
README
Couchbase SDK for Yii2 - 在您的 Yii 项目中使用 Couchbase
安装
安装此扩展的首选方法是通过 composer。
运行以下命令之一:
php composer.phar require --prefer-dist "miladalsh/couchbase-yii2": "dev-master"
或者
"miladalsh/couchbase-yii2": "dev-master"
将以下内容添加到您的 composer.json
文件的 require 部分。
用法
在应用配置中进行配置,如下所示
'components'=>array( 'couchbase' => array( 'class' => 'CCouchbaseConnection', //dsn of one of the nodes, * //the php client will determine if there are multiple nodes in the cluster 'connectionString' => 'couchbase://127.0.0.1', 'username' => 'Administrator', 'password' => '', )
在 CentOS/Redhat 上安装 couchbase 服务器和 PHP 客户端的说明
安装 couchbase php 客户端
sudo nano /etc/yum.repos.d/couchbase.repo
复制
[couchbase] enabled = 1 name = Couchbase package repository baseurl = get url from http://docs.couchbase.com/developer/c-2.4/download-install.html gpgcheck = 1 gpgkey = http://packages.couchbase.com/rpm/couchbase-rpm.key
保存文件
yum install libcouchbase2-core yum install libcouchbase-devel yum install libcouchbase2-bin yum install libcouchbase2-libevent pecl install couchbase
安装 couchbase-server
wget get url from http://www.couchbase.com/nosql-databases/downloads sudo rpm --install couchbase-server-enterprise-3.0.2-centos6.x86_64.rpm