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

package Cpanel::Easy::PHP5::cPPHPOpts;

#### ATTN EDIT ##
# any changes to options here need to be reflected in /usr/local/cpanel/scripts/makecpphp.profile.yaml
#### ATTN EDIT ##

our $easyconfig = {
    'name'    => 'Save my profile with appropriate PHP 5 options set so that it is compatible with cpphp',
    'version' => '$Rev: 3020 $',
    'implies' => {
        'Cpanel::Easy::PHP5::CurlSSL'     => 1,
        'Cpanel::Easy::PHP5::FTP'         => 1,
        'Cpanel::Easy::PHP5::GD'          => 1,
        'Cpanel::Easy::PHP5::Gettext'     => 1,
        'Cpanel::Easy::PHP5::Iconv'       => 0,    # reverse
        'Cpanel::Easy::PHP5::Imap'        => 1,
        'Cpanel::Easy::PHP5::MailHeaders' => 0,
        'Cpanel::Easy::PHP5::Mbstring'    => 1,
        'Cpanel::Easy::PHP5::Mbregex'     => 0,    # reverse
        'Cpanel::Easy::PHP5::Mysql'       => 1,
        'Cpanel::Easy::PHP5::Pgsql'       => 1,
        'Cpanel::Easy::PHP5::Sockets'     => 1,
        'Cpanel::Easy::PHP5::SysTimezone' => 1,
        'Cpanel::Easy::PHP5::Zlib'        => 1,
    },
    'modself' => sub {
        my ( $easy, $self_hr, $profile_hr ) = @_;

        my @info = $easy->get_system_mysql_info();
        my $type = $easy->get_php_mysql_support_type( $info[4], $info[3] );    # Case 130413
        $self_hr->{'implies'}{'Cpanel::Easy::PHP5::MysqlOfSystem'} = $type eq 'mysqlnd' ? 0 : 1;

        return ( 1, q{Ok} );
    },
    'step' => {
        '0' => {
            'name'    => 'profile was saved with the appropriate PHP 5 options set so that it is compatible with cpphp',
            'command' => sub {
                my ($self) = @_;
                $self->print_alert_color( 'blue', 'You have enabled cpphp compatibility: Some of your other php options may have been changed by this.' );
                return ( 1, 'Ok' );
            },

        },
    },
};

1;
