X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fhacked%2Fsrc%2FhackedProject.php;fp=web%2Fmodules%2Fcontrib%2Fhacked%2Fsrc%2FhackedProject.php;h=33f82e3d20b548b528b8fa82eb7438732cd1388c;hp=dcd684138a13c232e34b4c2c53f89372e6df2026;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/modules/contrib/hacked/src/hackedProject.php b/web/modules/contrib/hacked/src/hackedProject.php index dcd684138..33f82e3d2 100644 --- a/web/modules/contrib/hacked/src/hackedProject.php +++ b/web/modules/contrib/hacked/src/hackedProject.php @@ -1,10 +1,5 @@ name = $name; - $this->remote_files_downloader = new hackedProjectWebFilesDownloader($this); + $this->identify_project(); + + // Choose an appropriate downloader. + if ($this->isDevVersion()) { + $this->remote_files_downloader = new hackedProjectWebDevDownloader($this); + } + else { + $this->remote_files_downloader = new hackedProjectWebFilesDownloader($this); + } } /** @@ -110,6 +114,20 @@ class hackedProject { } } + /** + * Determines if the project is a development version or has an explicit release. + * + * @return boolean + * TRUE if the project is a dev release; FALSE otherwise. + */ + function isDevVersion() { + // Grab the version string. + $version = $this->existing_version; + + // Assume we have a dev version if the string ends with "-dev". + return (substr_compare($version, '-dev', -4, 4) === 0) ? TRUE : FALSE; + } + /** * Downloads the remote project to be hashed later. */