Server IP : 195.201.23.43 / Your IP : 3.128.190.205 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/webmin/virtual-server/ |
Upload File : |
#!/usr/bin/perl =head1 list-php-directories.pl List all directories in which a specific version of PHP has been activated By default this command outputs a table of directories for the virtual server specified with the C<--domain> parameter. However, the C<--multiline> flag can be used to output more detail about each directory in a format more easily parsed by other programs. Or if you just want a list of directories, use the C<--name-only> flag. By default only the base version numbers are shown, but you can switch to showing the complete version with the C<--full-version> flag. =cut package virtual_server; if (!$module_name) { $main::no_acl_check++; $ENV{'WEBMIN_CONFIG'} ||= "/etc/webmin"; $ENV{'WEBMIN_VAR'} ||= "/var/webmin"; if ($0 =~ /^(.*)\/[^\/]+$/) { chdir($pwd = $1); } else { chop($pwd = `pwd`); } $0 = "$pwd/list-users.pl"; require './virtual-server-lib.pl'; $< == 0 || die "list-php-directories.pl must be run as root"; } # Parse command-line args $owner = 1; while(@ARGV > 0) { local $a = shift(@ARGV); if ($a eq "--domain") { $domain = shift(@ARGV); } elsif ($a eq "--multiline") { $multi = 1; } elsif ($a eq "--name-only") { $nameonly = 1; } elsif ($a eq "--full-version") { $fullver = 1; } elsif ($a eq "--help") { &usage(); } else { &usage("Unknown parameter $a"); } } $domain || &usage("No domain specified"); $d = &get_domain_by("dom", $domain); $d || usage("Virtual server $domain does not exist"); @dirs = &list_domain_php_directories($d); if ($multi) { # Show on separate lines foreach $dir (@dirs) { my $fullver = &get_php_version($dir->{'version'}, $d); print $dir->{'dir'},"\n"; print " PHP version: $dir->{'version'}\n"; print " Full version: $fullver\n" if ($fullver); print " Execution mode: $dir->{'mode'}\n"; print " Web root directory: ", ($dir->{'dir'} eq &public_html_dir($d) ? "Yes" : "No"),"\n"; } } elsif ($nameonly) { # Just directories foreach $dir (@dirs) { print $dir->{'dir'},"\n"; } } else { # Show in table $fmt = "%-70.70s %-7.7s\n"; printf $fmt, "Directory", "Version"; printf $fmt, ("-" x 70), ("-" x 7); foreach $dir (@dirs) { my $v = $fullver ? &get_php_version($dir->{'version'}) : $dir->{'version'}; printf $fmt, $dir->{'dir'}, $v; } } sub usage { print "$_[0]\n\n" if ($_[0]); print "Lists web directories with different PHP versions in a virtual server.\n"; print "\n"; print "virtualmin list-php-directories --domain domain.name\n"; print " [--multiline | --name-only]\n"; print " [--full-version]\n"; exit(1); }Private