예제 #1
0
 public static function Select(Database $database, SelectionConstraints $constraints, $flag)
 {
     $query = self::QueryBase($flag);
     $query .= '
   FROM
     tracking_revisions
   LEFT JOIN
     tracking_authors ON tracking_authors.author_id = tracking_revisions.author_id
   ' . self::FlaggedJoinStatement($flag) . '
   WHERE
     ' . implode(' AND ', $constraints->constraints()) . '
   ORDER BY
     ' . $constraints->orderField() . ' ' . $constraints->order() . '
   LIMIT
     ' . $constraints->limit();
     return self::SelectCommitQuery($database, $query);
 }
예제 #2
0
<?php

// Copyright 2014 Peter Beverloo. All rights reserved.
// Use of this source code is governed by the MIT license, a copy of which can
// be found in the LICENSE file.
require_once __DIR__ . '/../services/framework/Database.php';
require_once __DIR__ . '/framework/AuthorList.php';
require_once __DIR__ . '/framework/CommitSelection.php';
require_once __DIR__ . '/framework/FlaggedCommitController.php';
require_once __DIR__ . '/framework/ProjectList.php';
require_once __DIR__ . '/framework/SelectionConstraints.php';
$database = new Database();
$constraints = new SelectionConstraints($database);
$flagged = new FlaggedCommitController($database);
$projects = ProjectList::LoadFromDatabase($database);
// The following options are available for selecting a range of commits. Some
// may be used in combination with other options, others may not. Options to
// this script will be accepted as either POST or GET variables.
//
// "from_date"       Earliest date to select commits from (YYYY-MM-DD).
// "to_date"         Latest date to select commits from (YYYY-MM-DD).
// "author"          E-mail address of the commit's author.
// "reverse"         Display commits in reversed (ascending) order.
// "tracker"         Id of the tracker from which commits can be selected.
// "since"           Display commits since the given date or text.
// "projects"        List of project Ids from which to select commits.
//
if (isset($_REQUEST['from_date'])) {
    $constraints->setEarliestCommitDate($_REQUEST['from_date'] . ' 00:00:00');
}
if (isset($_REQUEST['to_date'])) {