protected function guessBaseDir($hintLocation, $composerFileName)
    {
        // keep going up until we hit what we're looking for.
        do
        {
            $f = $hintLocation . '/' . $composerFileName;

            if (is_file($f))
            {
                return $hintLocation;
            }
            $prevLocation = $hintLocation;

            $hintLocation = $this->sanitisePaths(dirname($hintLocation));

            $ranOut = ($prevLocation === $hintLocation); // basically hit root directory
        }
        while (!$ranOut);


        throw new ExceptionPackageInfo('The trail went cold. Could not determine the location of the composer file and ran out of places to look.');
    }