Making WordPress.org


Ignore:
Timestamp:
11/01/2015 06:33:25 PM (11 years ago)
Author:
nacin
Message:

Trac Notifications: Fewer cross dependencies.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-db.php

    r2022 r2023  
    22/**
    33 * This class must execute queries valid for both MySQL and SQLite3.
     4 * The DB driver must be wpdb or Trac_Notifications_SQLite_Driver.
     5 * It must work without any other dependencies, such as WordPress.
    46 */
    5 class Trac_Notifications_DB {
     7class Trac_Notifications_DB implements Trac_Notifications_API {
    68    function __construct( $db ) {
    79        $this->db = $db;
     
    6062    }
    6163
    62     function get_component_history( $component ) {
    63         $days_ago = ( time() - ( 86400 * Make_Core_Trac_Components::last_x_days ) ) * 1000000;
     64    function get_component_history( $component, $last_x_days = 7 ) {
     65        $days_ago = ( time() - ( 86400 * $last_x_days ) ) * 1000000;
    6466        $closed_reopened = $this->db->get_results( $this->db->prepare( "SELECT newvalue, COUNT(DISTINCT ticket) as count
    6567            FROM ticket_change tc INNER JOIN ticket t ON tc.ticket = t.id
Note: See TracChangeset for help on using the changeset viewer.