package Cpanel::Easy::PHP5::Mcrypt;

# cpanel - Cpanel/Easy/PHP5/Mcrypt.pm             Copyright(c) 2011 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

our $easyconfig = {
    'name' => 'Mcrypt',
    'url'  => 'http://www.php.net/manual/en/ref.mcrypt.php',
    'step' => {
        '0' => {
            'name'    => 'Find mcrypt path for PHP 5',
            'command' => sub {
                my ($self) = @_;

                my ( $path, @text ) = $self->get_path_installed('Cpanel::Easy::OptLib::mcrypt');

                if ($path) {
                    $self->{'__'}{'McryptPath'} = $path;
                    return ( 1, 'Ok' );
                }
                else {
                    return $path, @text;
                }
            },
        },
        '2' => {
            'name'    => 'to config options',
            'command' => sub {
                my ($self) = @_;
                $self->add_to_configure( { '--with-mcrypt' => $self->{'__'}{'McryptPath'} } );
                return ( 1, 'Ok' );
            },
        },
    },
};

1;
