Apache-RandomImage

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

VERSION
    Version 0.3

SYNOPSIS
      Configure this module as a response handler to activate this module. The following
      examples will result in an image being randomly selected from the "images" directory.

        #mod_perl2 (PerlResponseHandler)
        <LocationMatch "^/(.+)/images/random-image">
            SetHandler modperl
            PerlSetVar Suffixes "gif png jpg"
            PerlResponseHandler Apache::RandomImage
        </LocationMatch>

        #mod_perl1 (PerlHandler)
        <Location "/images/give-random">
            SetHandler perl-script
            PerlSetVar Suffixes "gif png jpg tif jpeg"
            PerlHandler Apache::RandomImage
        </Location>

DESCRIPTION
    Apache::RandomImage will randomly select an image from the dirname of
    the requested location. You need to specify a white-space separated list
    of Suffixes with *PerlSetVar*, otherwise the request will be declined.

FUNCTIONS
  handler

examples/random-image.conf  view on Meta::CPAN

#mod_perl2 (PerlResponseHandler)
# Randomly selects an image from every "images" folder if the string "random-image"
# will be appended to the request
<LocationMatch "^/(.+)/images/random-image">
    SetHandler modperl
    PerlSetVar Suffixes "gif png jpg"
    PerlResponseHandler Apache::RandomImage
</LocationMatch>

#mod_perl1 (PerlHandler)
#<Location "/images/give-random">
#    SetHandler perl-script
#    PerlSetVar Suffixes "gif png jpg tif jpeg"
#    PerlHandler Apache::RandomImage
#</Location>

lib/Apache/RandomImage.pm  view on Meta::CPAN

our $VERSION = '0.3';

=head1 SYNOPSIS

  Configure this module as a response handler to activate this module. The following
  examples will result in an image being randomly selected from the "images" directory.

    #mod_perl2 (PerlResponseHandler)
    <LocationMatch "^/(.+)/images/random-image">
        SetHandler modperl
        PerlSetVar Suffixes "gif png jpg"
        PerlResponseHandler Apache::RandomImage
    </LocationMatch>

    #mod_perl1 (PerlHandler)
    <Location "/images/give-random">
        SetHandler perl-script
        PerlSetVar Suffixes "gif png jpg tif jpeg"
        PerlHandler Apache::RandomImage
    </Location>

=head1 DESCRIPTION

Apache::RandomImage will randomly select an image from the dirname of the requested location.
You need to specify a white-space separated list of B<Suffixes> with I<PerlSetVar>,
otherwise the request will be declined.

=head1 FUNCTIONS



( run in 2.042 seconds using v1.01-cache-2.11-cpan-df04353d9ac )