Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Compatibility with new PHP Mongo driver #223

Open
julien-c opened this issue Apr 3, 2016 · 5 comments
Open

Compatibility with new PHP Mongo driver #223

julien-c opened this issue Apr 3, 2016 · 5 comments

Comments

@julien-c
Copy link

julien-c commented Apr 3, 2016

I haven't been able to find anything about this here, sorry if it's been asked before.

Any there any plans to support the new PHP Mongo driver in the PHP version of Genghis?

Thanks!

@arabcoders
Copy link

arabcoders commented Apr 26, 2016

i have it working right now using the following,

go to where the genghis.php file is and do the following

composer require alcaeus/mongo-php-adapter

create new file eg index.php

<?php
require 'vendor/autoload.php';
require 'genghis.php';

the package alcaeus/mongo-php-adapter act as backwards compatible interfaces for the new mongodb driver, until the folks here update the app.

@doradsoft
Copy link

I have done exactly what you said and it's not working.

@rhclayto
Copy link

rhclayto commented Mar 8, 2017

I installed mongo-php-adapter, added require_once 'vendor/autoload.php'; to the head of genghis.php, & changed

if (!class_exists('Mongo', false)) { $alerts[] = array( 'level' => 'error', 'msg' => '<h4>Mongo PHP class not found.</h4> ' . 'Have you installed and enabled the <strong>PECL Mongo drivers</strong>?', ); }

to

if (!class_exists('MongoDB\Driver\Manager', false)) { $alerts[] = array( 'level' => 'error', 'msg' => '<h4>Mongo PHP class not found.</h4> ' . 'Have you installed and enabled the <strong>PECL Mongo drivers</strong>?', ); }

to get rid of the warning message.

Everything works.

The performance using the alcaeus/mongo-php-adapter on top of the new mongodb driver+mongodb-php-library is also considerably worse than the legacy driver or the new mongodb driver+mongodb-php-library combination. Perhaps 3-4 times worse! However, for a web-based interface, not part of an application, it shouldn't matter too much.

@henkealg
Copy link

henkealg commented Jun 4, 2017

Hi @rhclayto , a ported php version of Genghis can be found Here.
This version makes real use of the new MongDB driver and php-library (composer mongodb/mongodb).
I have used it myself for a while now both for handling plain document as well as gtidFS collections.

@julien-c
Copy link
Author

Alternatively, we built a new, more modern Web-based client for Mongo, inspired by Genghis:
https://github.com/huggingface/Mongoku

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants