2017 © Pedro Peláez
 

library yii2-mongo-odm

PHPMongo Yii2 Adapter

image

phpmongokit/yii2-mongo-odm

PHPMongo Yii2 Adapter

  • Tuesday, January 30, 2018
  • by sokil
  • Repository
  • 2 Watchers
  • 2 Stars
  • 632 Installations
  • PHP
  • 0 Dependents
  • 2 Suggesters
  • 1 Forks
  • 2 Open issues
  • 3 Versions
  • 32 % Grown

The README.md

Yii2 adapter for PHPMongo ODM

Yii Adapter for PHPMongo ORM, (*1)

Build Status Total Downloads Daily Downloads, (*2)

Requirements

Installation

You can install library through Composer:, (*3)

composer require phpmongokit/yii2-mongo-odm

Compatibility with PHP 7

PHPMongo currently based on old ext-mongo entension. To use this ODM with PHP 7, you need to add compatibility layer, which implement API of old extension over new ext-mongodb. To start using PHPMongo with PHP7, add requirement alcaeus/mongo-php-adapter to composer. Restrictions for using ODM with compatibility layer you can read in known issues of original adapter., (*4)

Add adapter of old ext-mongo API to new ext-mongodb:, (*5)

composer require alcaeus/mongo-php-adapter

Configuration of Client

<?php

return array(
    'components' => array(
        // configure mongo service
        'mongo' => array(
            'class' => 'PHPMongoKit\ODM\Adapter\Yii2\Client',
            'dsn' => 'mongodb://127.0.0.1',
            'options' => array(
                'connect' => true,
                'readPreference' => \MongoClient::RP_SECONDARY_PREFERRED,
            ),
            'defaultDatabase' => 'database_name',
            'map' => array(
                'database_name' => array(
                    'collectionName1' => '\Collection\Class1',
                    'collectionName2' => '\Collection\Class2',
                )
            )
        ),
    )
);

The Versions

30/01 2018

dev-master

9999999-dev http://phpmongokit.github.io/

PHPMongo Yii2 Adapter

  Sources   Download

MIT

The Requires

 

by Dmytro Sokil

30/01 2018

0.1.1

0.1.1.0 http://phpmongokit.github.io/

PHPMongo Yii2 Adapter

  Sources   Download

MIT

The Requires

 

by Dmytro Sokil

05/01 2017

0.1

0.1.0.0 http://phpmongokit.github.io/

PHPMongo Yii2 Adapter

  Sources   Download

MIT

The Requires

 

by Dmytro Sokil