Exemplo n.º 1
0
 function testLog()
 {
     $table = new FoosTable(dirname(__FILE__) . '/testData/');
     $table->loadCurrentStatus();
     $table->setLogMaxSize(15);
     $table->calculateScore();
     $log = $table->getLog();
     $this->assertEqual(count($log), 15);
     $this->assertEqual(count($log[0]), 11);
 }
Exemplo n.º 2
0
//** Controller **//
// Delete
if (isset($_GET['delete'])) {
    $timestamp = $_GET['delete'] * 1;
    $tmpTable = new FoosTable($workingPath);
    $tmpTable->loadCurrentStatus();
    $tmpTable->deleteMatch($timestamp);
    $tmpTable->saveToFile();
    // Remove ?delete=xxx part from URL
    header('Location: foos.php');
    die;
}
// Current data
$table = new FoosTable($workingPath);
$maxGamesInGraph = 50;
$table->setLogMaxSize($maxGamesInGraph);
$table->loadCurrentStatus();
$table->calculateScore();
// Table with data 48h old (to display changes)
$tableOld = new FoosTable($workingPath);
$tableOld->loadStatusForTime(time() - 48 * 60 * 60);
$tableOld->calculateScore();
//** View **//
?>
<!doctype html>
<html lang="en" class="no-js">
<head>
    <meta charset="utf-8">
    <title>#last.foos</title>
    <meta name="description" content="Foos.fm">
    <link rel="stylesheet" href="style.css">