mirror of
https://github.com/webmin/webmin.git
synced 2025-08-19 01:15:14 +00:00
Start of work on debian-style php modules
This commit is contained in:
@ -688,17 +688,48 @@ foreach my $f (readdir(DIR)) {
|
|||||||
my $ini = { 'file' => $f,
|
my $ini = { 'file' => $f,
|
||||||
'path' => $path,
|
'path' => $path,
|
||||||
};
|
};
|
||||||
|
# Check for the extension line
|
||||||
my $lref = &read_file_lines($path, 1);
|
my $lref = &read_file_lines($path, 1);
|
||||||
foreach my $l (@$lref) {
|
foreach my $l (@$lref) {
|
||||||
if ($l =~ /^\s*(;?)\s*extension\s*=\s*(\S+(\.so)?)/) {
|
if ($l =~ /^\s*(;?)\s*(zend_)?extension\s*=\s*(\S+(\.so)?)/) {
|
||||||
$ini->{'enabled'} = $1 ? 0 : 1;
|
$ini->{'enabled'} = $1 ? 0 : 1;
|
||||||
$ini->{'mod'} = $2;
|
$ini->{'mod'} = $3;
|
||||||
$ini->{'mod'} =~ s/\.so$//;
|
$ini->{'mod'} =~ s/\.so$//;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (-l $path) {
|
||||||
|
# Debian-style, where the link means that the module is enabled
|
||||||
|
$ini->{'link'} = &resolve_links($path);
|
||||||
|
$ini->{'enabled'} = 1;
|
||||||
|
}
|
||||||
push(@rv, $ini);
|
push(@rv, $ini);
|
||||||
}
|
}
|
||||||
closedir(DIR);
|
closedir(DIR);
|
||||||
|
my $availdir = &simplify_path("$dir/../../mods-available");
|
||||||
|
if (opendir(DIR, $availdir)) {
|
||||||
|
# On debian, there is another directory of link destinations for all
|
||||||
|
# modules that are available
|
||||||
|
foreach my $f (readdir(DIR)) {
|
||||||
|
next if ($f !~ /\.ini$/);
|
||||||
|
my $path = "$availdir/$f";
|
||||||
|
my ($already) = grep { $_->{'link'} eq $path } @rv;
|
||||||
|
next if ($already);
|
||||||
|
my $ini = { 'file' => $f,
|
||||||
|
'path' => $path,
|
||||||
|
'enabled' => 0,
|
||||||
|
'available' => 1,
|
||||||
|
};
|
||||||
|
my $lref = &read_file_lines($path, 1);
|
||||||
|
foreach my $l (@$lref) {
|
||||||
|
if ($l =~ /^\s*(;?)\s*(zend_)?extension\s*=\s*(\S+(\.so)?)/) {
|
||||||
|
$ini->{'mod'} = $3;
|
||||||
|
$ini->{'mod'} =~ s/\.so$//;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
push(@rv, $ini);
|
||||||
|
}
|
||||||
|
closedir(DIR);
|
||||||
|
}
|
||||||
return sort { $a->{'mod'} cmp $b->{'mod'} } @rv;
|
return sort { $a->{'mod'} cmp $b->{'mod'} } @rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user