InstalledVersions::isInstalled( string $packageName, bool $includeDevRequirements = true )

Checks whether the given package is installed


Description Description

This also returns true if the package name is provided or replaced by another package


Top ↑

Parameters Parameters

$packageName

(string) (Required)

$includeDevRequirements

(bool) (Optional)

Default value: true


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: libraries/lifterlms-cli/vendor/composer/InstalledVersions.php

    public static function isInstalled($packageName, $includeDevRequirements = true)
    {
        foreach (self::getInstalled() as $installed) {
            if (isset($installed['versions'][$packageName])) {
                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
            }
        }

        return false;
    }

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.