albertborsos / yii2-couchbase
Couchbase component for Yii 2.0 Framework
Installs: 634
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 1
Type:yii2-extension
Requires
- php: >=7.1.0
- yiisoft/yii2: ~2.0.0
Requires (Dev)
- codeception/base: ~3.0
- codeception/mockery-module: ^0.3.0
- codeception/specify: ~1.0
- codeception/verify: ~1.0
- mito/yii2-coding-standards: ~2.0.0@beta
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ~7.5
This package is auto-updated.
Last update: 2024-10-30 02:26:45 UTC
README
Yii 2.0 Couchbase Component
Couchbase component for Yii 2.0 Framework
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist albertborsos/yii2-couchbase "*"
or add
"albertborsos/yii2-couchbase": "*"
to the require section of your composer.json
file.
Usage
Create couchbase.ini
:
extension=couchbase.so ; priority=30
To install couchbase to docker, add these lines to your Dockerfile.dev
:
#install couchbase extension RUN curl -O http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-6-amd64.deb RUN dpkg -i couchbase-release-1.0-6-amd64.deb RUN apt-get update && \ apt-get install -y --no-install-recommends \ libcouchbase-dev build-essential php-pear php-dev zlib1g-dev RUN pecl install couchbase ADD couchbase.ini /etc/php/7.3/mods-available/couchbase.ini RUN phpenmod couchbase
For development use the following docker-compose image configuration
cb: image: couchbase/server volumes: - ~/couchbase/cb:/opt/couchbase/var ports: - 8091 - 11210
Then you have to configure the component:
return [ ... 'components' => [ ... 'couchbase' => [ 'class' => \albertborsos\couchbase\Connection::class, 'dsn' => 'cb', 'username' => 'frontend', 'password' => 'frontend', 'defaultBucketName' => 'frontend', 'defaultBucketPassword' => 'frontend', ], ... ], ... ];