sasanrose / phpredmin

Yet another web interface for Redis
BSD 3-Clause "New" or "Revised" License
404 stars 96 forks source link

Can't select a DB #52

Closed godoffrags closed 10 years ago

godoffrags commented 10 years ago

Hi,

i like PHPRedmin. Installation was no problem. But my redis Server contains 3 DBs. For default PHPRedmin select DB 0. That is OK. I see the other DBs on the left side with the count of entrys. But if i click on one they select already the DB 0. I don't know what i do wrong. The URL show correct "...welcome/index/0/1" or "...welcome/index/0/2"

Could somebody help me or fix this?

sasanrose commented 10 years ago

@topdatagmbh, I didn't get your problem. I would be grateful if you could explain more.

godoffrags commented 10 years ago

There are no log entrys in php log or your logs. I test it in the newest firefox and newest chrome. In both i have the problem. PHPRedmin runs on a amazon instance. I wrote you to your gmail email a access for the redmin.

sasanrose commented 10 years ago

I tried and checked your instance of phpredmin and I confirm there was a problem with database selection. However, I am not able to debug it. Since, I don't have any access to the files and my own local instance works fine. We need more information for debugging this problem.

toubsen commented 10 years ago

I can confirm that behaviour on my own instance. The culprit are the following lines in "libraries/controller.php", which will not work against Redis 2.4.x

    $databasesConfig = $this->_objects['db']->config('GET', 'databases');
    $current['max_databases'] = $databasesConfig['databases'];

Thus the max_databases will be set to zero against Redis 2.4, which in turn will always discard the passed "dbId" URL param.

This could be circumvented by using the INFO command againts redis, and then parsing the maximum dbId prefix from the output, but would then only catch the databases that have keys defined.

Best workaround to support such old versions is probably to allow to configure the maximum database number in config.php

toubsen commented 10 years ago

I made small changes to my local instance to allow manual configuration of the max database count. Sent you a pull request for this, which unfortunately ended up in a new issue, as I missed how to let it appear here (sorry fo the duplicate).

blitzmann commented 10 years ago

I just got new hosting with 2.4, and I can also confirm this bug. @toubsen's fix seems to work

godoffrags commented 10 years ago

Fix work :) Thanks

blitzmann commented 10 years ago

A fix for this has been merged, go ahead and close the issue if you don't mind. =)