GithubHelp home page GithubHelp logo

guoyu07 / phpredmin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sasanrose/phpredmin

0.0 1.0 0.0 1.08 MB

Yet another web interface for Redis

License: BSD 3-Clause "New" or "Revised" License

PHP 11.85% ApacheConf 0.01% CSS 1.41% JavaScript 86.73%

phpredmin's Introduction

PHPRedMin

PHPRedMin is a simple web interface to manage and monitor your Redis.

Technologies Used

Gearman application framework

Nanophp framework

Bootstrap front-end framework

JQuery JavaScript library

Nvd3 reusable chart library for d3.JS

Note: PHPRedmin is mostly compatible with phpredis redis module for PHP

Installation

Just drop phpredmin in your webserver's root directory and point your browser to it (You also need phpredis installed)

Apache configuration example (/etc/httpd/conf.d/phpredmin.conf):

# phpredmin - Simple web interface to manage and monitor your Redis
# 
# Allows only localhost by default

Alias /phpredmin /var/www/phpredmin/public

<Directory /var/www/phpredmin/>
   AllowOverride All 

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip localhost
       Require local
     </RequireAny>
   </IfModule>

   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

Note: If your redis server is on an IP or port other than defaults (localhost:6379), you should edit config.php file

Features

Multi-Server functionality

You can add as many redis servers as you want to your config.php file and choose between the defined servers from the menu available on the left side of all pages in PHPRedMin:

We must credit Eugene Fidelin for his great contributions to implement this feature

Statistics

Note: If you want this feature to work, you have to setup the cron to gather data from your redis server as follows:

* * * * * root cd /var/www/phpredmin/public && php index.php cron/index

Memory

CPU And Clients

Keys and Connections

Databases

Console

PHPRedMin provides you with a web-base redis console. This functionality takes advantage of PHP's exec function. Although, all the commands are escaped for security, you can disable terminal from configuration file. In addition, you can set history limit or disable history by setting it to 0:

Info

Information about your redis setup

Configurations

View your redis runtime configurations

Slowlog

Find slow redis commands

Note: PHPRedMin uses eval to fetch slow log. So to use this feature you need redis version >= 2.6.0

Database Manipulation

You can easily switch between databases belonging to different servers easily:

You can flush selected database or all databases. You can also save database to a file on disk:

Key-Value Manipulation

Search

The search box will let you to easily search keys in the selected database: Note: Becareful, since this still doesn't support pagination, try to limit your search otherwise if your search result is too long (e.g. *) then your browser might crash.

The search results will be shown to you as a table. In this table besides the basic information about each key, PHPRedMin provides you with some actions:

  • Expire (Sets TTL for a key)
  • View (Shows keys' value/values and lets you manipulate it/them)
  • Rename
  • Move (Moves key to another database)
  • Delete

Add key-Value

From the main page of PHPRedMin you can add different types of key-values.

Strings

Hashes

Lists

Sets

Sorted Sets

View keys' values

PHPRedMin makes it easier for you to manage your lists, hashes, sets and sorted sets. After searching for a special key, you can choose view action to see the contents of that key (According to its type) and manipulate them.

Lists

Note: This supports pagination

Hashes

Sets

Note: This supports pagination

Note: Thanks to Ahmed Hamdy you can now edit members of a set

Sorted Sets

Note: This supports pagination

Bulk Actions

Bulk Delete

This feature lets you delete a key or a bunch of keys using wild cards

Note: This feature needs gearman. You have to both install gearman and php gearman extension

Gearman Worker

You can run gearman worker using the following command:

php index.php gearman/index

You can also setup a service for this command. I prefer supervisord to make it always running. Here is my config file:

[program:phpredmin]
directory=/var/www/phpredmin/public
command=php index.php gearman/index
process_name=%(program_name)s
numprocs=1
stdout_logfile=/var/log/supervisor/phpredmin.log
autostart=true
autorestart=true
user=sasan

License

BSD 3-Clause License

Copyright © 2013, Sasan Rose

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the PHPRedMin nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

phpredmin's People

Contributors

sasanrose avatar blitzmann avatar eugef avatar nilportugues avatar toubsen avatar lzref avatar nervo avatar blackikeeagle avatar stuntguy3000 avatar marios-zindilis avatar hemeragp avatar gsouf avatar tortuetorche avatar ahmed-hamdy90 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.