The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mojolicious::Plugin::Redis - Simply use Redis in Mojolicious

VERSION

Version 0.03

INSTALLATION

To install this module, run the following commands:

        perl Build.PL
        ./Build
        ./Build test
        ./Build install

SYNOPSIS

Provides a few helpers to ease the use of Redis in your Mojolicious application.

        use Mojolicious::Plugin::Redis
        
        sub startup {
          my $self = shift;
                
          $self->plugin('redis', { 
                  server => 'localhost:6379',
                  debug => 0,
                  encoding => undef, # Disable the automatic utf8 encoding => much more performance
                  helper => 'db'
                });
        }

CONFIGURATION OPTIONS

    helper      (optional)  The name to give to the easy-access helper if you want to change it's name from the default
    no_helper   (optional)  When set to true, no helper will be installed.

All other options passed to the plugin are used to connect to Redis. In other words ANY option can be sended to Redis module.

HELPERS/ATTRIBUTES

redis_connection

This plugin attribute holds the Redis::Connection object, use this if you need to access it for some reason.

db

This helper will return the database handler. If you have renamed the helper, use that name instead of 'db' in the example below :)

    sub someaction {
      my $self = shift;
          
          # ping Redis server
          $self->db->PING();
          
          # get value of 'foo' named key
          $self->db->GET('foo');

    }

DEVELOPMENT

Repository

    http://github.com/Meettya/Mojolicious-Plugin-Redis

AUTHOR

Meettya, meettya@cpan.org

BUGS

Please report any bugs or feature requests to bug-mojolicious-plugin-redis at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mojolicious-Plugin-Redis. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Mojolicious::Plugin::Redis

You can also look for information at:

ACKNOWLEDGEMENTS

Ben van Staveren (inspiration from Mojolicious::Plugin::Mongodb), so I didn't have to write it myself, just copy-paste. Sergey Zasenko for test fix.

COPYRIGHT & LICENSE

Copyright 2011 Meettya, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.