function getReleasesPromoFile($repoName, &$modified) { $cache_id_versions_json = "{$repoName}_versions_json"; // Fetch cached info $cache = apcu_fetch($cache_id_versions_json, $success); if (!$success || isset($_GET['nocache'])) { $mc_versions = getReleases($repoName, $releases_modified); $promoFile = array(); $promoFile['homepage'] = "https://team-io.net/{$repoName}.php#downloads"; $promoFile['promos'] = array(); foreach ($mc_versions as $version) { $promoFile['promos'][$version->mc_version . '-latest'] = $version->latest; $promoFile['promos'][$version->mc_version . '-recommended'] = $version->recommended; $promoFile[$version->mc_version] = $version->changelog; } $cache = new CacheValue(); $cache->data = $promoFile; $cache->modified = $releases_modified; apcu_store($cache_id_versions_json, $cache, cache_time); } $promoFile = $cache->data; $modified = $cache->modified; return $promoFile; }
return $outFile; } /** * Unpack the archive * * @param string $archiveFile The path of the archive to be extracted * * @return void */ function extractArchive($archiveFile) { echo "Unpacking archive ...\n"; $cmd = "tar -zxf {$archiveFile} --strip 2 --wildcards */src"; $test = shell_exec($cmd); echo "Unpacked finished."; } $releases = getReleases(); // Use master release by default $selectedRelease = 'master'; // Check if a release as been selected manually if (isset($argv[1])) { $selectedRelease = $argv[1]; } // Fails if selected release does not exists if (!isset($releases[$selectedRelease])) { echo "Error : Release {$selectedRelease} does not exist\n"; die; } $archiveFile = downloadRelease($releases[$selectedRelease]); extractArchive($archiveFile); echo "MongoGento sucessfully installed.\n";
function body() { ?> <article> <h1>Want to support this mod?</h1> <p> Check our <a href="https://www.patreon.com/Team_IO?ty=h">Patreon</a> page! </p> </article> <article> <h1>Taam</h1> <p>Presenting: Taam Industries latest collection of gadgets and tools for the heavy industry. Join the line of our valued customers and found your own factory. Expand your business with the high performance conveyor system. Build a production line tailored to your needs. Make your factory safe and sound using our collection of building materials and utilities.</p> <p>Taam is a mod for Minecraft 1.9.4 and 1.10.2.<br /> The last stable release is for 1.7.10, but the beta releases for 1.9 and 1.10 become more stable with every release.</p> <p>We add a production line using conveyors, machines and appliances, various gadgets, building blocks and tools. And there is more on our todo-list! Check the wiki for more info.</p> </article> <article> <a href="https://github.com/Team-IO/taam/wiki" onmouseenter="linkByTag(this);" onmouseout="unlink();" class="bigbutton"> Wiki </a> <a href="https://github.com/Team-IO/taam/issues" onmouseenter="linkByTag(this);" onmouseout="unlink();" class="bigbutton"> Issues </a> <a href="https://github.com/Team-IO/taam" onmouseenter="linkByTag(this);" onmouseout="unlink();" class="bigbutton"> Repository </a> <a href="http://minecraft.curseforge.com/projects/taam" onmouseenter="linkByTag(this);" onmouseout="unlink();" class="bigbutton"> CurseForge </a> </article> <article> <a id="milestones"></a> <h2>Milestones</h2> <?php function echo_milestone($mile) { echo "<a href=\"{$mile->html_url}\" onmouseenter=\"linkByTag(this);\" onmouseout=\"unlink();\" class=\"milestone bigbutton\"><span class=\"ms_name\">{$mile->title}<span>"; echo '<span class="progress_parent"><span class="progress_bar"'; $progress = 0; $total_issues = $mile->closed_issues + $mile->open_issues; if ($total_issues > 0) { $progress = $mile->closed_issues / $total_issues * 100; } echo " style=\"width: {$progress}%\"></span></span>"; echo "<span class=\"ms_stats\">Open Issues: {$mile->open_issues} Closed Issues: {$mile->closed_issues}<span></a> "; } $cache = new CacheControl('taam_milestones', '/repos/Team-IO/taam/milestones'); $milestones = $cache->content; echo '<h3>Versions:</h3>'; foreach ($milestones as $mile) { if (0 === strpos($mile->title, 'Version')) { echo_milestone($mile); } } echo '<h3>Implementation Phases:</h3>(planned features, not in current version)<br />'; foreach ($milestones as $mile) { if (0 !== strpos($mile->title, 'Version')) { echo_milestone($mile); } } ?> <h3>Current Build Status:</h3> <p> <span class="bold">Master <span class="smallgrey">(1.9.4)</span>:</span> <a href="https://travis-ci.org/Team-IO/taam"><img src="https://img.shields.io/travis/Team-IO/taam/master.svg?maxAge=3600" alt="Build Status" /></a> </p> <p> <span class="bold">Dev Branches:</span> <a href="https://travis-ci.org/Team-IO/taam"><img src="https://img.shields.io/travis/Team-IO/taam/1.10.svg?maxAge=3600&label=1.10.2" alt="Build Status" /></a> <a href="https://travis-ci.org/Team-IO/taam"><img src="https://img.shields.io/travis/Team-IO/taam/1.9.svg?maxAge=3600&label=1.9.4" alt="Build Status" /></a> <a href="https://travis-ci.org/Team-IO/taam"><img src="https://img.shields.io/travis/Team-IO/taam/1.8.svg?maxAge=3600&label=1.8.9%20(Discontinued)" alt="Build Status" /></a> <a href="https://travis-ci.org/Team-IO/taam"><img src="https://img.shields.io/travis/Team-IO/taam/1.7.10.svg?maxAge=3600&label=1.7.10%20(Discontinued)" alt="Build Status" /></a> </p> <p> 1.9.4 and 1.10.2 will both be maintained in parallel as long as feasible. </p> </article> <article> <a id="downloads"></a> <h2>Downloads</h2> <table> <?php $mc_versions = getReleases('taam', $modified); foreach ($mc_versions as $mc_version) { echo "<tr><th>Minecraft {$mc_version->mc_version}</th></tr>"; foreach ($mc_version->versions as $rel) { ?> <tr class="release<?php if ($rel->prerelease) { echo ' beta'; } ?> "> <td> <?php foreach ($rel->assets as $asset) { echo "<a href=\"{$asset->browser_download_url}\">⇩ {$asset->name}</a><br />"; $size = get_size_display($asset->size); echo "<span class=\"smallgrey\">Size: {$size} DL: {$asset->download_count}</span><br />"; } ?> </td> <?php echo "<td>{$rel->version}"; if ($rel->prerelease) { echo "<br />({$rel->suffix})"; } echo "</td>"; ?> <td> <a href="<?php echo $rel->changelog_url; ?> ">Changelog</a> </td> </tr> <?php } } ?> </table> <a href="https://team-io.net/taam-updates.php">Machine-Readable Version</a> </article> <article> <a id="media"></a> <h2>Media</h2> </article> <?php }