public function createComposerInMemoryPackage($targetDir, $version)
    {
        $url = $this->getURL($version);

        $versionParser = new VersionParser();
        $normVersion = $versionParser->normalize($version);

        $package = new Package(static::PHANTOMJS_NAME, $normVersion, $version);
        $package->setTargetDir($targetDir);
        $package->setInstallationSource('dist');
        $package->setDistType(pathinfo($url, PATHINFO_EXTENSION) === 'zip' ? 'zip' : 'tar'); // set zip, tarball
        $package->setDistUrl($url);

        return $package;
    }
public function createComposerInMemoryPackage($targetDir, $version)
    {
        $url = $this->getURL($version);

        $versionParser = new VersionParser();
        $normVersion = $versionParser->normalize($version);

        $package = new Package(static::PHANTOMJS_NAME, $normVersion, $version);
        $package->setTargetDir($targetDir);
        $package->setInstallationSource('dist');
        $package->setDistType(pathinfo($url, PATHINFO_EXTENSION) === 'zip' ? 'zip' : 'tar'); // set zip, tarball
        $package->setDistUrl($url);

        return $package;
    }
public function createComposerInMemoryPackage ( $ targetDir , $ version ) { $ url = $ this -> getURL ( $ version ) ; $ versionParser = new VersionParser ( ) ; $ normVersion = $ versionParser -> normalize ( $ version ) ; $ package = new Package ( static :: PHANTOMJS_NAME , $ normVersion , $ version ) ; $ package -> setTargetDir ( $ targetDir ) ; $ package -> setInstallationSource ( 'dist' ) ; $ package -> setDistType ( pathinfo ( $ url , PATHINFO_EXTENSION ) === 'zip' ? 'zip' : 'tar' ) ; // set zip, tarball $ package -> setDistUrl ( $ url ) ; return $ package ; }
Returns a Composer Package, which was created in memory.

@param string $targetDir
@param string $version
@return Package
Returns a Composer Package which was created in memory .