public function getPackageVersions($global = false)
    {
        // different commands for project specific and global packages
        if ($global) {
            exec('php ../vendor/composer/composer/bin/composer global show --installed 2> /dev/null', $packages);
        } else {
            exec('php ../vendor/composer/composer/bin/composer show --installed --working-dir=.. 2> /dev/null', $packages);
        }

        // prepare the array
        return array_map(function ($package) use (&$global) {
            // some regex to parse the package string
            $elements = preg_split('/\s+/', $package);

            // prep a new array.
            $match = array(
                'Scope' => ($global) ? 'Global' : 'Project',
                'Package' => $elements[0],
            );

            // ensure to keep the hash if it has been defined
            if (true
                && array_key_exists(2, $elements)
                && strlen($elements[2]) == 7
                && strtolower($elements[2]) == $elements[2]
            ) {
                $match['Version'] = $elements[1].' '.$elements[2];
            } else {
                $match['Version'] = $elements[1];
            }

            // return
            return $match;
        }, $packages);
    }