public function addFileFromBasedir($pathname, $basedir = '')
    {
        $info = new \SplFileInfo($pathname);

        if (!$info->isFile())
        {
            throw new InvalidArgumentException(sprintf('File not found: %s', $pathname));
        }

        if (!$info->isReadable())
        {
            throw new InvalidArgumentException(sprintf('File not readable: %s', $pathname));
        }

        $relativePathname = $this->subtractBasedir($pathname, $basedir);
        #echo sprintf("%s\n", $relativePathname);

        if ($basedir && $pathname === '/' . $relativePathname)
        {
            throw new InvalidArgumentException(sprintf('Invalid basedir: %s', $basedir));
        }

        $this->zip->addFile($pathname, $relativePathname);
    }