Kernel::System::CheckEnvironment::PerlModules

NAME

Kernel::System::CheckEnvironment::PerlModules – Environment check for required Perl modules.

PUBLIC INTERFACE

new()

Don't use the ObjectManager, use it directly instead:

    use Kernel::System::CheckEnvironment::PerlModules;
    my $PerlModulesObject = Kernel::System::CheckEnvironment::PerlModules->new();
    $PerlModulesObject->Run();

The ObjectManager should not be used especially when using this module from a script, because we want this to always work, no matter if any dependencies fail.

_PackageList()

Returns a hash with commands and a list of packages which can be installed with each command.

    my %PackagesByCommand = $PerlModulesObject->_PackageList(
        [
            {
                Module    => 'Archive::Tar',
                Required  => 1,
                Comment   => 'Required for compressed file generation (in perlcore).',
                InstTypes => {
                    emerge => 'perl-core/Archive-Tar',
                    zypper => 'perl-Archive-Tar',
                    ports  => 'archivers/p5-Archive-Tar',
                },
            },
            {
                Module    => 'Archive::Zip',
                Required  => 1,
                Comment   => 'Required for compressed file generation.',
                InstTypes => {
                    aptget => 'libarchive-zip-perl',
                    emerge => 'dev-perl/Archive-Zip',
                    zypper => 'perl-Archive-Zip',
                    ports  => 'archivers/p5-Archive-Zip',
                },
            },
            ...
        ],
    );

    Returns:

        my %PackagesByCommand = (
            'apt-get install -y' => {
                SubCMD => 'perl(%s)',
                Packages => [
                    'libarchive-zip-perl',
                    'libtimedate-perl',
                    'libdatetime-perl',
                ],
            },
            'cpan %s' => {
                Packages => [
                    'CryptX',
                    'Specio',
                    'Specio::Subs',
                ],
            },
        );
Scroll to Top