public function getAllInstalledPackages(bool $rescan = false): array
    {
        if (!$rescan && !empty(self::$allInstalledPackages)) {
            return self::$allInstalledPackages;
        }

        $compiledFile = $this->pathHelper->realize('{MELIOR_BASE}/Data/Persistent/Compiler/Packages/package.map');
        if (!$rescan && is_file($compiledFile)) {
            $result = \unserialize(\file_get_contents($compiledFile));
        } else {
            $result = array_merge(
                $this->getLibraries($rescan),
                $this->getPlugins($rescan),
                $this->getApplicationPackages($rescan)
            );
        }

        self::$allInstalledPackages = $result;

        return $result;
    }