WordPress.org

Making WordPress.org

Changeset 2027


Ignore:
Timestamp:
11/02/2015 05:33:50 AM (5 years ago)
Author:
nacin
Message:

Prepare Trac subscriptions to be enabled on meta.trac. see #291.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications
Files:
4 edited

Legend:

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

    • Property svn:eol-style set to native
    r2026 r2027  
    1212        }
    1313
    14         $url = add_query_arg( array(
    15             'call'   => $method,
    16             'secret' => $this->secret,
    17         ), $this->target );
     14        $url = add_query_arg( 'call', $method, $this->target );
    1815
    1916        $args = array(
    20             'body' => array( 'arguments' => json_encode( $arguments ) ),
     17            'body' => array(
     18                'arguments' => json_encode( $arguments ),
     19                'secret'    => $this->secret,
     20            ),
    2121        );
    2222
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-http-server.php

    • Property svn:eol-style set to native
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-sqlite-driver.php

    r2026 r2027  
    3737    public function get_var( $query ) {
    3838        if ( $q = $this->db->query( $query ) ) {
    39             return $q->fetchColumn();
     39            $var = $q->fetchColumn();
     40            if ( $var !== false ) {
     41                return $var;
     42            }
    4043        }
     44        return null;
    4145    }
    4246
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php

    r2026 r2027  
    1313    protected $components;
    1414
    15     protected $tracs_supported = array( 'core', 'meta', 'themes', 'plugins' );
    16     protected $tracs_supported_extra = array( 'bbpress', 'buddypress', 'gsoc', 'glotpress' );
     15    protected $tracs_supported = array( 'core', 'meta', /* 'themes', 'plugins' */ );
     16    protected $tracs_supported_extra = array( /* 'bbpress', 'buddypress', 'gsoc', 'glotpress' */ );
    1717
    1818    function __construct() {
     
    2626        }
    2727
    28         if ( function_exists( 'add_db_table' ) ) {
     28        $this->trac = $trac;
     29
     30        if ( 'core' === $trac && function_exists( 'add_db_table' ) ) {
    2931            $tables = array( 'ticket', '_ticket_subs', '_notifications', 'ticket_change', 'component', 'milestone', 'ticket_custom' );
    3032            foreach ( $tables as $table ) {
     
    3234            }
    3335        }
    34         $this->api = new Trac_Notifications_DB( $GLOBALS['wpdb'] );
     36
     37        if ( 'core' === $trac ) {
     38            $this->api = new Trac_Notifications_DB( $GLOBALS['wpdb'] );
     39        } else {
     40            $this->api = new Trac_Notifications_HTTP_Client( $this->trac_url() . '/wpapi', TRAC_NOTIFICATIONS_API_KEY );
     41        }
    3542
    3643        if ( 'core' === $trac ) {
     
    3845            $this->components = new Make_Core_Trac_Components( $this->api );
    3946        }
    40 
    41         $this->trac = $trac;
    4247
    4348        add_filter( 'allowed_http_origins', array( $this, 'filter_allowed_http_origins' ) );
Note: See TracChangeset for help on using the changeset viewer.