| Server IP : 104.21.17.213 / Your IP : 216.73.217.141 Web Server : Apache System : Linux hosting01.arsenalhost.com 4.18.0-425.13.1.lve.el8.x86_64 #1 SMP Mon Feb 27 15:23:24 EST 2023 x86_64 User : corbizre ( 1013) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/lve/modlscapi/utils/ |
Upload File : |
#!/usr/local/cpanel/3rdparty/bin/perl
# Copyright (c) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2026 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
BEGIN { unshift @INC, '/usr/local/cpanel', '/scripts'; }
my $pckg_name = 'Cpanel';
use strict;
eval "use " .$pckg_name . "::CPAN::Hash::Merge ();";
if ($@){
$pckg_name = 'cPScript';
eval "use " .$pckg_name . "::CPAN::Hash::Merge ();";
}
use strict;
use warnings;
#eval "use " .$pckg_name . "::CPAN::Hash::Merge ();";
eval "use " .$pckg_name . "::DataStore ();";
no warnings 'uninitialized';
my $main_conf_ref = Cpanel::DataStore::fetch_ref('/var/cpanel/conf/apache/main');
my $ref_type=ref($main_conf_ref->{'main'}{'include'}{'items'});
my $etalon_ref={"main"=>{"include"=>{"directive"=>"include","items"=>[{include=>"\"/usr/local/apache/conf/php.conf\""}]}}};
if ($ref_type eq 'ARRAY'){
my $res=$main_conf_ref->{'main'}{'include'}{'items'};
my $find=0;
my $empty_find=0;
for(my $index=0;$index<@$res;$index++)
{
my $item_ref=@$res[$index];
if ( !defined($item_ref->{'include'})) {
$empty_find = 1;
} else {
if ( index($item_ref->{'include'},"php.conf")!=-1 ){
$find=1;
}
}
}
if ( $find==0 ){
for(my $index=0;$index<@$res;$index++)
{
my $item_ref=@$res[$index];
if ( index($item_ref->{'include'},"php.conf")!=-1 ){
delete @$res[$index];
}
}
push(@$res,{ "include"=>"\"/usr/local/apache/conf/php.conf\"" });
Cpanel::DataStore::store_ref( '/var/cpanel/conf/apache/main', $main_conf_ref );
}
if( $empty_find==1 ) {
@$res = grep { defined $_ } @$res;
Cpanel::DataStore::store_ref( '/var/cpanel/conf/apache/main', $main_conf_ref );
}
} else {
$main_conf_ref->{'main'} = Cpanel::CPAN::Hash::Merge::merge($main_conf_ref->{'main'}, $etalon_ref->{'main'});
Cpanel::DataStore::store_ref( '/var/cpanel/conf/apache/main', $main_conf_ref );
}