public function extract($source)
    {
        $tmpDirectory = null;

        $this->assertSourceAsFile($source);
        $folder = \tao_helpers_File::createTempDir();
        $zip = new ZipArchive();
        if ($zip->open($source) === true) {
            if (\tao_helpers_File::checkWhetherArchiveIsBomb($zip)) {
                throw new PortableElementExtractException(sprintf('Source %s seems to be a ZIP bomb', $source));
            }
            if($zip->extractTo($folder)){
                $tmpDirectory = $folder;
            }
            $zip->close();
        }

        if (! is_dir($tmpDirectory)) {
            throw new PortableElementExtractException('Unable to extract portable element.');
        }

        return $tmpDirectory;
    }