bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 165 forks source link

Compatibility with new PHP Mongo driver #223

Open julien-c opened 8 years ago

julien-c commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

rhclayto commented 7 years ago

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 commented 7 years ago

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 commented 5 years ago

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