Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions front-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
$isNewEnv = preg_match('#env\/new/?$#', $q);
$isRecentlyClonedEnvs = preg_match('#recently-cloned-environments/?$#', $q);
$isCapturing = preg_match('#capturing-environment#', $q);
$isFYP = preg_match('#fyp#', $q);

$currentUrl = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";

Expand All @@ -48,4 +49,8 @@
$file = 'recently-cloned-environments';
}

if($isFYP) {
require_once('model-fyp.php');
}

require_once('front-view.php');
52 changes: 52 additions & 0 deletions model-fyp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

$url = 'https://api.github.com/repos/Precise-Pixels/cell/contributors';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_USERAGENT => 'JaL-User-Agent',
CURLOPT_SSL_VERIFYPEER => false));
$contributors = json_decode(curl_exec($curl));

$commits = $contributors[0]->contributions + $contributors[1]->contributions + $contributors[2]->contributions;

$url = 'https://api.github.com/repos/Precise-Pixels/cell/branches?per_page=100&page=1';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_USERAGENT => 'JaL-User-Agent',
CURLOPT_SSL_VERIFYPEER => false));
$branches1 = json_decode(curl_exec($curl));

$url = 'https://api.github.com/repos/Precise-Pixels/cell/branches?per_page=100&page=2';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_USERAGENT => 'JaL-User-Agent',
CURLOPT_SSL_VERIFYPEER => false));
$branches2 = json_decode(curl_exec($curl));

$branches = count($branches1) + count($branches2);

$url = 'https://api.github.com/repos/Precise-Pixels/cell/pulls?state=all&per_page=100&page=1';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_USERAGENT => 'JaL-User-Agent',
CURLOPT_SSL_VERIFYPEER => false));
$pulls1 = json_decode(curl_exec($curl));

$url = 'https://api.github.com/repos/Precise-Pixels/cell/pulls?state=all&per_page=100&page=2';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_USERAGENT => 'JaL-User-Agent',
CURLOPT_SSL_VERIFYPEER => false));
$pulls2 = json_decode(curl_exec($curl));

$pulls = count($pulls1) + count($pulls2);
18 changes: 16 additions & 2 deletions views/fyp.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
<section>
<div class="section-padding align-centre lgrey">
<h1><i class="ico-cell-logo"></i>THE PROJECT</h1>
<p class="full">Cell Industries is a Multimedia Technology and Design University of Kent final year project by <a href="http://jacobhammond.co.uk/" target="_blank">Jacob Hammond</a>, <a href="http://jalproductions.co.uk/" target="_blank">James Lee</a> and <a href="http://faooful.com/" target="_blank">Joseph Williams</a>.</p>
<p class="full">More information coming soon.</p>
<p class="full">Cell Industries is a Multimedia Technology and Design University of Kent Final Year Project by <a href="http://precisepixels.co.uk" target="_blank">Precise Pixels</a>:</p>
<p class="full"><a href="http://jacobhammond.co.uk/" target="_blank">Jacob Hammond</a><br>
<a href="http://jalproductions.co.uk/" target="_blank">James Lee</a><br>
<a href="http://faooful.com/" target="_blank">Joseph Williams</a></p>
<p class="full">For more information, see the <a href="http://precisepixels.co.uk/blog/" target="_blank">Progress Blog</a>.</p>
</div>
</section>

Expand All @@ -23,4 +26,15 @@
</div>
</section>

<section>
<div class="section-padding align-centre lgrey">
<h1><i class="ico-cell-logo"></i>GITHUB INFO</h1>
<p>URL: <a href="https://github.com/Precise-Pixels/cell" target="_blank">https://github.com/Precise-Pixels/cell</a></p>
<p>Language Distribution: PHP 49.5% | Javascript 29.5% | CSS 21.0%</p>
<p>Commits: <?= $commits; ?></p>
<p>Branches: <?= $branches; ?></p>
<p>Pull Requests: <?= $pulls; ?></p>
</div>
</section>

</main>