/**
  * Gets the runs data
  *
  * @param array $timestamps We will get the runs files from their timestamp (is part of the name).
  * @return bool Whether runs are comparable or not.
  */
 public function parse_runs(array $timestamps)
 {
     foreach ($timestamps as $timestamp) {
         if (!is_numeric($timestamp)) {
             die('Error: Timestamps are supposed to be [0-9]' . PHP_EOL);
         }
         // Creating the run object and parsing it.
         $run = new test_plan_run($timestamp);
         $run->parse_results();
         $this->runs[] = $run;
     }
     // Stop when runs are not comparables between them.
     if (!$this->check_runs_are_comparable()) {
         return false;
     }
     return true;
 }
<?php

include __DIR__ . '/webapp/inc.php';
if (!($filename = $_GET['filename'])) {
    die('Error: No filename to delete');
}
if (!preg_match('/^\\d*$/', $filename, $matches)) {
    die('Error: Incorrect filename');
}
$run = new test_plan_run($filename);
$run->download();
<?php

include __DIR__ . '/webapp/inc.php';
$properties = properties_reader::get('readonlyweb');
if (!empty($properties['readonlyweb'])) {
    die('Error: You are not allowed to perform write actions from the web interface');
}
if (!($filename = $_GET['filename'])) {
    die('Error: No filename to delete');
}
if (!preg_match('/^\\d*$/', $filename, $matches)) {
    die('Error: Incorrect filename');
}
$returnurl = urldecode($_GET['returnurl']);
$run = new test_plan_run($filename);
if (!$run->delete()) {
    echo '<b>Error: There was a problem deleting the file</b>';
} else {
    echo '<p>Run deleted</p>';
    // Remove the deleted one.
    $timestamps = explode('&', $returnurl);
    foreach ($timestamps as $key => $timestamp) {
        if (strstr($timestamp, $filename) != false) {
            unset($timestamps[$key]);
        }
    }
    $returnurl = implode('&', $timestamps);
}
// Link to return to the index.
echo '<br/><br/><a href="index.php?' . $returnurl . '">Return to the runs page</a>';